Anoconda虚拟环境下打开jupyter notebook出现The kernel has died, and the automatic restart has failed的解决办法

Debbie ·
更新时间:2024-09-20
· 727 次阅读

原创链接(转载请注明出处):https://blog.csdn.net/qq_44091004/article/details/105684698

激活虚拟环境,启动jupyter notebook

1.打开cmd,输入activate name(你的虚拟环境的名字)
2.输入jupyter notebook后会打开jupyter notebook 可能会出现kernel died的问题。

解决办法

1.重新打开cmd ,输入jupyter kernelspec list,查看你的jupyter里有几个kernel,一般如果没额外安装过,会只显示一个path。
2.再次激活虚拟环境(activate name),然后输入
pip install ipykernel
3.通过ipykernel为jupyter添加python环境,输入
python -m ipykernel install --name env_name(这里的name是创建的核的名字,可以与你的虚拟环境一致)

ImportError: cannot import name 'generator_to_async_generator’的错误以及解决办法

1.pip uninstall -y ipython prompt_toolkit
2.pip install ipython prompt_toolkit
需要注意的是,在进行第一步卸载的时候,为确保卸载干净,可进行多次pip uninstall 指令。
3.再次通过输入
python -m ipykernel install --name env_name
这时,应该就成功了,可以打开jupyter notebook,–>kernel–>change kernel,会看到你创建的kernel name,切换后就可以放心使用了。


作者:资料加载中



has 环境 AND restart notebook kernel jupyter

需要 登录 后方可回复, 如果你还没有账号请 注册新账号