conda中jupyter notebook常见报错解决 以及 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

# (base):

conda install -c conda-forge widgetsnbextension

# (env-name):

conda install -c conda-forge ipywidgets

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

conda update jupyter

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

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

4.conda的一种jupyter配置方案

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

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

pip uninstall -y jupyter
pip uninstall -y jupyter_core
pip uninstall -y jupyter-client
pip uninstall -y jupyter-console
pip uninstall -y notebook
pip uninstall -y qtconsole
pip uninstall -y nbconvert
pip uninstall -y nbformat

4.2base环境下安装

# 这里-c是指定从anaconda处下载jupyter包,但是可能不是最新版
conda install -c anaconda jupyter
# 不是的话更新一下
conda update jupyter

# 或者直接conda install jupyter,不过我没试过,原理上应该好用的

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

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

4.4注册jupyter进入环境变量

如果没有注册系统环境变量会导致其他环境下不能使用jupyter notebook命令,令人伤心
  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值