1.安装jupyter
pip install jupyter
如果安装报错,则安装
sudo apt-get install libsqlite3-dev
2.生成配置文件:
jupyter notebook --generate-config
(该文件在 /home/username/.jupyter/jupyter_notebook_config.py)
3.生成密码:
#ipython (或者Python)
from notebook.auth import passwd
passwd()
Enter password: #在此处输入密码
Verify password: #确认输入密码
然后会生成:
Out:‘sha1:5ab...............' #为生成的密码,复制一下,后面会用到
4.修改配置文件 ~/.jupyter/jupyter_notebook_config.py
vim ~/.jupyter/jupyter_notebook_config.py
此处需要更改的:
c.NotebookApp.ip='*’ #此处默认为localhost,更改为任意ip
c.NotebookApp.password = u'sha1:5ab..............' #此处为之前自行设置的密码,粘贴到此处
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #该处端口号可任意设置,8889,9999等,默认为8888
#ps:注意!!!!一定要去掉前面的注释,才可以有用。
保存退出
esc
shift+:
wq
- 启动jupyter
jupyter notebook
然后打开浏览器输入:
1.如果是远程登录linux服务器:
https://服务器地址:8889/ (此处8889为之前设置的端口号)
2.如果是本机:
https://localhost:8889/