Ubuntu Server 安装 Jupyter Notebook
Ubuntu Server 安装 Jupyter Notebook

记录 Ubuntu Server 安装 Jupyter Notebook 的过程 基于阿里云 Ubuntu Server 18 参考文献:远程访问jupyter notebook
准备工作
输入python3 -V确认Python版本是否大于3.5,并安装pip3
sudo apt install python3-pip
安装Jupyter Notebook
sudo pip3 install jupyter
配置Python
生成配置文件
jupyter notebook --generate-config
生成密码
输入
python3
并在python命令行中输入:
from notebook.auth import passwd
passwd()
然后输入两次设定的密码
把生成的密文sha1:6e7b1d14fec9:4117f11a1fc7bf6613fcca869c2c3d99a4fb7cf6复制下来
修改配置
vi ~/.jupyter/jupyter_notebook_config.py
并找到以下条目并修改:
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:6e...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口,不要是443和80等重要端口
添加自动补全功能的插件
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable
启动Jupyter Notebook
jupyter notebook
如果是用的root账户,用
jupyter notebook --allow-root
启用补全功能
在阿里云中打开相应端口即可通过ip:端口访问Jupyter Notebook
能看到增加了一个 Nbextensions 标签页,在这个页面里,勾选 Hinterland 即可
评论