Ubuntu:在anaconda中使用jupter

使用anaconda的环境:

1
source activate NAME

开启环境后,使用python安装jupyter

1
pip install jupyter

创建配置文件

1
jupyter notebook --generate-config

会生成~/.jupyter/jupyter_notebook_config.py文件。

自动生成密码

1
jupyter notebook password

会生成密码,生成的密码存储在 jupyter_notebook_config.json。

1
2
3
4
$ jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json

修改配置文件

1
vi ~/.jupyter/jupyter_notebook_config.py

在最上面增加:

1
2
c.NotebookApp.ip='0.0.0.0'
c.NotebookApp.port =8888

分别指定的是可以访问的ip(网上大部分是设置为*,但是在我这会报错,设置成0.0.0.0可以成功),部署端口。

启动

输入

1
jupyter notebook

即可开启。如果要后台运行,输入

1
nohup jupyter notebook &

即可。

-------------本文结束 感谢您的阅读-------------