配置-jupyter notebook快速配置
安装必要的插件
pip3 install yapf
pip install autopep8 --user
pip3 install jedi==0.17.2
生成密码
from notebook.auth import passwd
passwd()
xxx12345+
'argon2:$argon2id$v=19$m=10240,t=10,p=8$U4zUU7WDdXK1GAiqZHiBKw$/uIJNKuzQbJx6kxZLJD53A'
生成配置文件
jupyter notebook --generate-config
c.NotebookApp.password
配置目录和密码
vim ~/.jupyter/jupyter_notebook_config.py
126 c.NotebookApp.notebook_dir
c.NotebookApp.browser
c.NotebookApp.allow_root =True
c.NotebookApp.ip = ‘*’
c.NotebookApp.open_browser = False
c.NotebookApp.password = ''
c.NotebookApp.port = 8888
安装扩展
pip3 install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
pip3 install --user jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
# 自动化脚本
#!/bin/bash
# Install Jupyter
pip3 install jupyter
# Generate Jupyter config file
jupyter notebook --generate-config
# Set Jupyter config options
echo "c.NotebookApp.allow_root = True" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.ip = '0.0.0.0'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser = False" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.password = 'sha1:$(echo -n '123456' | sha1sum | awk '{print $1}')'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.password = 'sha1:2b2ff3b3fc1c:0e675f766b7d22d0a84dc9a9f0b89b14cfdcb5d5'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port = 8888" >> ~/.jupyter/jupyter_notebook_config.py
# Start Jupyter
# Install Jupyter extensions
pip3 install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
pip3 install --user jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user