Jupyter Notebook安装与配置
程序员文章站
2022-03-03 20:50:01
...
1. 安装ipython, jupyter
pip install ipython
pip install jupyter
2.创建配置文件
jupyter notebook --generate-config
会在当前用户进入目录生成.jupyter目录,并生成jupyter_notebook_config.py文件,如
/root/.jupyter/jupyter_notebook_config.py
3.生成密码
1)在终端输入ipython 进入ipython界面
2)输入下面两行命令
from notebook.auth import passwd
passwd()
3)根据提示输入两次密码,然后复制界面输出的字符长串
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'argon2:$argon2id$v=19$m=10240,t=10,p=8$1eEGdP3pQxhSiSnEOsPIOA$pseS7SD4ddZf//FR7N5eFB'
4.修改配置文件
vi /root/.jupyter/jupyter_notebook_config.py,定位到文件末尾添加下面几项配置
一般添加下面几项就行:
c.NotebookApp.password ='argon2:$argon2id$v=19$m=10240,t=10,p=8$1eEGdP3pQxhSiSnEOsPIOA$pseS7SD4ddZf//FR7N5eFB'
c.NotebookApp.ip='*'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8080
allow_remote_access = True
c.NotebookApp.notebook_dir = '/data/jupyter'
推荐阅读