jupyter安装笔记

环境:win10子系统,

基本步骤

1
2
python3 -m pip install --upgrade pip
python3 -m pip install jupyter

参考:https://jupyter.org/install.html

报错解决

allow_root

运行notebook:

1
jupyter notebook

输出信息如下:

1
2
[I 19:33:39.307 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[C 19:33:43.147 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.

需要修改配置文件(我这里用的是vim编辑器):

1
vim /root/.jupyter/jupyter_notebook_config.py

找到下面的内容:

1
#c.NotebookApp.allow_root = False

并修改为:

1
c.NotebookApp.allow_root =True

参考:https://www.cnblogs.com/Annian/p/9103892.html

set password

运行jupyter notebook后打开网页(localhost:8888),显示输入密码,但是我本身没有设置密码。于是使用命令行修改密码:

1
jupyter notebook password

就可以看到当前目录下的文件了。

参考:https://jupyter-notebook.readthedocs.io/en/stable/public_server.html