一、检查Python环境python -V
二、通过pip安装jupyterpip install jupyter
三、生成jupyter配置文件#root客户:
jupyter notebook --generate-config --allow-root
#非root客户
jupyter notebook --generate-config
四、打开ipython,生成密码[root@xxj]# ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
会让输入两次密码,输入完成后,复制生成的秘钥,后面会用到,秘钥带上sha1。
五、修改配置文件,root用户默认在root目录vim /root/.jupyter/jupyter_notebook_config.py
修改以下几个地方:c.NotebookApp.ip = 'xx.xxx.xx.xxx' 即对外提供访问的ip,云服务外网ip
c.NotebookApp.port = 8888 即对外提供访问的端口
c.NotebookApp.open_browser = False False即启动不打开浏览器
c.NotebookApp.password = u'sha1:XXXXX' 这个就是上面生成的秘钥
c.NotebookApp.notebook_dir = u'/opt/jupyter_dir' 即设置jupyter启动后默认的根目录
六、启动jupyter
root用户nohup jupyter notebook --allow-root&
非root用户nohup jupyter notebook&
相关文章教程推荐:jupyter教程