踩坑估计是所有程序员都要遇到的,关键就是能不能从坑里起来。如果起不来,就会原地脱发,直到憔悴。
因此,又开一个“可能只有我自己看”的专栏——“坑记”,记录每次挣扎出坑,那么下次再掉……呸呸呸,重说,大家掉坑里,也有个指南爬出来。有趣的坑千篇一律,希望能有所参考。
坑名
背景:vscode下使用jupyter插件,因为在anaconda建立了新的环境,想在jupyter使用的时候,添加新环境的kernel。
备注:安装环境中包的时候,只使用过
pip install jupyter
然后系统自动安装了依赖库。然后坑出现,在运行notebook的时候,出现:
Kernel died with exit code 1(VS code)
摘录网上一大佬的同坑详情(自己遇到坑时没想过能走出来)
C:\Users\rohit\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.
py:2195: FutureWarning: Supporting extra quotes around Unicode is deprecated in traitlets 5.0. Use 'hmac-sha256' instead of '"hmac-sha256"' – or use CUnicode.
warn( C:\Users\rohit\AppData\Roaming\Python\Python38\site-packages\traitlets\traitlets.
py:2150: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0.
Use '8fe74386-11f1-4831-b37d-5582442edf8a' instead of 'b"8fe74386-11f1-4831-b37d-5582442edf8a"'...
说这么多,意思就是traitlets库的问题,实际上并不需要调整这个库,查了一下只需要在6.0版本及一下就行。
出坑方式
用anaconda进入自己新建的环境,选择uninstall,输入jupyter。意思是看看和jupyter有关的库我到底少装了什么。然后装上。
再到anaconda prompt下,activate自己需要的环境。
输入:jupyter notebook
打开网页版,选择我们的环境作为kernel。
只要不报错就行啦。
留下jupyter设置参考
>>jupyter --version
jupyter core : 4.7.1
jupyter-notebook : 6.4.0
qtconsole : 5.1.1
ipython : 7.22.0
ipykernel : 5.3.4
jupyter client : 6.1.12
jupyter lab : not installed
nbconvert : 6.1.0
ipywidgets : 7.6.3
nbformat : 5.1.3
traitlets : 5.0.5
不要误会,大佬是 朱庇特。