在python3虚拟环境中安装jupyter notebook 并确保正常启动

如何创建python3虚拟环境可以参考我的这篇文章https://blog.****.net/qq_26870933/article/details/81502484

使用 source /虚拟环境路径/py3/bin/activate 进入python3虚拟环境

pip install numpy

pip install pandas

pip install setuptools

pip install --ignore-installed six

pip install python-dateutil

pip install jupyter

以上包都安装完成后,直接执行jupyter notebook 就可以自动打开浏览器(文件路径默认是当前文件路径)

但很可能会遇到以下问题 A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.(无法建立与笔记本服务器的连接。笔记本电脑将继续尝试重新连接。检查网络连接或笔记本服务器配置。)导致我们无论执行什么语句都没有反应。

原因是tornado版本太高了,默认是tornado-6.0.1,我们只需将其卸载并安装一个底版本即可。

pip uninstall tornado

pip install tornado==5.1.1

重新执行jupyter notebook 即可正常运行。

在python3虚拟环境中安装jupyter notebook 并确保正常启动

完毕!