当前位置:   article > 正文

conda中jupyter notebook常见报错解决 以及 conda一种jupyter重装方案(彻底解决)_conda启动jupyter报错

conda启动jupyter报错

文章简介

注意:本文基于win系统conda环境,为本人遇到相关问题的解决办法,其他系统同理。前面是一些一般问题的解决(本人遇到的,供大家参考),后面是jupyter重装的一种方案(本人部署笔记)。如有错误和不足欢迎指出

1.nb_conda与python版本问题

        nb_conda版本与python版本不匹配。nb_conda只支持python3.9以下版本。本人之前虚拟环境中低版本python安装有nb_conda,确实nb,但是在本人查看环境时造成了很大误导。之后低版本应该也不会再安装了。

        如果要卸载nb_conda(一般也没必要卸载,只是本人采用的部署方案不一样,用不到它了)

conda uninstall nb_conda

2.运行notebook时报错,报错:提示jupyter和ipywidgets版本更新

        这篇文章提供的方案很实用

报错ImportError: IProgress not found. Please update jupyter and ipywidgetsicon-default.png?t=N7T8https://blog.csdn.net/qq_35812205/article/details/122237916

  1. # (base):
  2. conda install -c conda-forge widgetsnbextension
  3. # (env-name):
  4. conda install -c conda-forge ipywidgets

        如果确实要更新的话运行如下代码

conda update jupyter

3.jupyter notebook启动后没有找到虚拟环境内核kernal

  1. #进入对应的虚拟环境,下载包
  2. pip install --user ipykernel
  3. #使用包,让该环境注册到notebook中
  4. python -m ipykernel install --user --name=[env-name]
  5. 补充:网上也有人说这个方案会报错,需要进一步找原因,但本人运行没有问题。可能是因为我只有一个jupyter,安装在base环境下的原因

4.conda的一种jupyter配置方案

说明:在base环境中安装jupyter,在其他环境中注册jupyter内核,注册环境变量使用

4.1卸载(在所有安装有jupyter的环境中都适用,nb_conda如前文单独卸载)

  1. pip uninstall -y jupyter
  2. pip uninstall -y jupyter_core
  3. pip uninstall -y jupyter-client
  4. pip uninstall -y jupyter-console
  5. pip uninstall -y notebook
  6. pip uninstall -y qtconsole
  7. pip uninstall -y nbconvert
  8. pip uninstall -y nbformat

4.2base环境下安装

  1. # 这里-c是指定从anaconda处下载jupyter包,但是可能不是最新版
  2. conda install -c anaconda jupyter
  3. # 不是的话更新一下
  4. conda update jupyter
  5. # 或者直接conda install jupyter,不过我没试过,原理上应该好用的

4.3进入虚拟环境配置notebook内核

  1. pip install --user ipykernel
  2. python -m ipykernel install --user --name=[env-name]

4.4注册jupyter进入环境变量

如果没有注册系统环境变量会导致其他环境下不能使用jupyter notebook命令,令人伤心
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/149932
推荐阅读
相关标签
  

闽ICP备14008679号