设置默认的Python为Python3
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
安装并配置jupyter notebook
pip install jupyter
jupyter notebook --generate-config
记录下config文件地址
进入python环境下
from notebook.auth import passwd
passwd()
Enter password:
Verify password:
Out: 'sha1:xxxxxxxx'
复制一整串
nano ~/.jupyter/jupyter_notebook_config.py #一般是在这
找到相应项,去掉注释,改为如下
c.NotebookApp.ip=' 0.0.0.0' # 允许所有ip访问
c.NotebookApp.password = u'sha1:xxxxxxxxxxxxxx'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 1234 # 访问端口
c.NotebookApp.notebook_dir = 'workspace/' # 工作目录