在学习jupyter notebook时,我在Jupyter Notebook的界面新建了一个文档,如下所示
当我点进去对文档就行重命名操作,出现error信息,我发现在终端里出现如下报错,并且中断了jupyter notebook.
搜索了很多回答,说是因为建立windos用户名使用了中文,而很多pyhon以及pyhon相关的库对中文路径是很不友好的(好巧不巧鄙人用户名就是"德玛西亚",心中一万匹草泥马奔过),大概的解决方案如下
1:修改windows用户名(感觉此方法一劳永逸,避免出现因为此类原因造成的问题)
感谢大佬提供的解决方案:
修改windows用户名
但是此类方法,环境变量中使用了中文也需要进行更改.我比较怕麻烦,有没有不更改用户名的办法呢
2:降级pyzmq版本
使用pip list查了下我的pyzmq版本为23.2.0,网上所说使用的都是19.0.2,此次我下载的为22.1.0版本,重命名也是可以的
先卸载你安装的pyzmq
(datasci) D:\>pip uninstall pyzmq
Found existing installation: pyzmq 23.2.0
Uninstalling pyzmq-23.2.0:
Would remove:
d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages\pyzmq-23.2.0.dist-info\*
d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages\zmq\*
Proceed (Y/n)? Y
Successfully uninstalled pyzmq-23.2.0
安装指定版本pyzmq22.1.0
(datasci) D:\>pip install pyzmq==22.1.0
Collecting pyzmq==22.1.0
Downloading pyzmq-22.1.0-cp38-cp38-win_amd64.whl (1.0 MB)
---------------------------------------- 1.0/1.0 MB 170.4 kB/s eta 0:00:00
Installing collected packages: pyzmq
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jupyter-client 7.3.5 requires pyzmq>=23.0, but you have pyzmq 22.1.0 which is incompatible.
Successfully installed pyzmq-22.1.0
安装成功,但是出现以上ERROR信息,意思为:
pip 的依赖项解析器当前未考虑安装的所有包。此行为是以下依赖项冲突的根源
jupter-client 7.3.5需要pyzmq版本大于23.0,但是你的pyzmq版本19.0.2是不支持的
继续解决方案:降低jupyter-client
的版本,先卸载,后重新安装jupyter-client==7.2.0
。
(datasci) D:\>pip uninstall jupyter-client
Found existing installation: jupyter_client 7.3.5
Uninstalling jupyter_client-7.3.5:
Would remove:
d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages\jupyter_client-7.3.5.dist-info\*
d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages\jupyter_client\*
d:\learnbigdata\anaconda3\envs\datasci\scripts\jupyter-kernel-script.py
d:\learnbigdata\anaconda3\envs\datasci\scripts\jupyter-kernel.exe
d:\learnbigdata\anaconda3\envs\datasci\scripts\jupyter-kernelspec-script.py
d:\learnbigdata\anaconda3\envs\datasci\scripts\jupyter-kernelspec.exe
d:\learnbigdata\anaconda3\envs\datasci\scripts\jupyter-run-script.py
d:\learnbigdata\anaconda3\envs\datasci\scripts\jupyter-run.exe
Proceed (Y/n)? Y
Successfully uninstalled jupyter_client-7.3.5
成功卸载后,安装jupyter-client==7.2.0版本
(datasci) D:\>pip install jupyter-client==7.2.0
Collecting jupyter-client==7.2.0
Downloading jupyter_client-7.2.0-py3-none-any.whl (130 kB)
---------------------------------------- 130.5/130.5 kB 349.7 kB/s eta 0:00:00
Requirement already satisfied: nest-asyncio>=1.5.1 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (1.5.5)
Requirement already satisfied: tornado>=5.0 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (6.2)
Requirement already satisfied: traitlets in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (5.1.1)
Requirement already satisfied: pyzmq>=17 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (22.1.0)
Requirement already satisfied: entrypoints in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (0.4)
Requirement already satisfied: python-dateutil>=2.1 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (2.8.2)
Requirement already satisfied: jupyter-core>=4.9.2 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-client==7.2.0) (4.10.0)
Requirement already satisfied: pywin32>=1.0 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from jupyter-core>=4.9.2->jupyter-client==7.2.0) (302)
Requirement already satisfied: six>=1.5 in d:\learnbigdata\anaconda3\envs\datasci\lib\site-packages (from python-dateutil>=2.1->jupyter-client==7.2.0) (1.16.0)
Installing collected packages: jupyter-client
Successfully installed jupyter-client-7.2.0
安装成功,没有错误信息了,重新打开jupyter notebook即可
完美解决!!!