【已解决】jupyter各包之间不匹配的诸多问题

前一天用jupyter忘记关闭服务直接关机了,第二天出现了如下问题:

Error executing Jupyter command 'notebook': [Errno 2] No such file or directory

于是开始了漫长的修复环境之路。
1、卸载jupyter的所有包

jupyter
jupyter-client
jupyter-console 
jupyter-core 

卸载完成之后重新安装上述包。注意只用pip uninstall不行,需要把

/PlayGround/anaconda3/envs/py352/lib/python3.5/site-packages

下jupyter相关的包删除。
2、重装完jupyter后,由于版本不对应,此时主要是与nbconvert包版本不对应。此时jupyter服务可以打开,但是进行操作时会出现如下错误:

500 : Internal Server Error

此时可以选择从新安装nbconvert。
3、但是重装nbconvert会导致与

ipython

版本不对应。从而出现以下错误

ImportError: cannot import name 'create_prompt_application' 

继续卸载重装ipython。
4、又会导致与

ipykernel

版本不对应,从而一直导致jupyter后台一直重启kernel:

jupyter KernelRestarter: restarting kernel (1/5), new random ports

最终重装ipykernel,问题done!

总结:
一开始只是想省事简单pip以下,没有考虑包之间的依赖关系,结果却绕远了。如果各位想重装的时候,最快捷的方法是:全部卸载,删除文件夹再安装如下包:

ipykernel
ipython
jupyter
jupyter-client
jupyter-core
jupyter-console

  • 6
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值