1.Linux安装Anaconda
2.配置Jupyter
1)生成登陆密码(后续配置文件,登录时候需要)
输入两次密码
python # 进入python终端
from notebook.auth import passwd
passwd()
记住输出的密码钥匙字符串‘sha1:7c4fcb395887:52d061c8399e04d9aac678635192056b5c84da10’,
然后通过exit()
退出ipython
环境
2)生成配置文件
[root@master ~]# jupyter notebook --generate-config
[C 21:56:27.433 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.
[root@master ~]# jupyter notebook --generate-config --allow-root
Writing default config to: /root/.jupyter/jupyter_notebook_config.py
3)修改配置文件
c.NotebookApp.ip = '*' # 允许访问此服务器的 IP,星号表示任意 IP
c.NotebookApp.password = u'sha1:xxxx' # 之前生成的密码 hash 字串
c.NotebookApp.open_browser = False # 运行时不打开本机浏览器
c.NotebookApp.port = 8888 # 使用的端口
c.NotebookApp.enable_mathjax = True # 启用 MathJax
#c.NotebookApp.notebook_dir = '' # 存放文件的目录
#c.NotebookApp.allow_remote_access = True # 允许远程访问
3.启动服务
[root@master ~]# jupyter notebook --allow-root
[W 22:20:35.622 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 22:20:35.633 NotebookApp] Serving notebooks from local directory: /root
[I 22:20:35.633 NotebookApp] 0 active kernels
[I 22:20:35.633 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/
[I 22:20:35.633 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
4.浏览器访问