赞
踩
pip3 install jupyter
pip3 install ipython
# jupyter notebook --version
6.4.10
用于后面写入ip,端口号,密码等
jupyter notebook --generate-config
# 启动ipython,配置密码(注意不是python)
ipython
In [1]: from notebook.auth import passwd # 导入包
In [2]: passwd() # 调用包
Enter password: # 输入密码,用于后面登陆jupyter notebook
Verify password: # 确认密码
Out[2]: 'sha1:ce23d945972f:111111' #这段是密钥,复制下来等会用
exit() #退出
vim /root/.jupyter/jupyter_notebook_config.py
内容
c.NotebookApp.ip = '*' #允许任何ip去访问我们的jupyter notebook
c.NotebookApp.password = u'sha1:ce23d945972f:111111' #u后面加上你复制的密钥
c.NotebookApp.open_browser = False #因为是在linux,就不让他打开浏览器了
c.NotebookApp.port = 8888 #随便指定一个端口,如果这个端口被占用,jupyter会加1重新找端口,直到找到为止
c.NotebookApp.allow_remote_access = True #允许远程控制
c.NotebookApp.notebook_dir = u'/app/jupyter_notebook/data' # 设置你打开jupyter notebook的时候想显示的位置,可以设置成经常使用的路径
# 创建目录
mkdir -p /app/jupyter_notebook/{data,log}
cd /app/jupyter_notebook/log/
# 后台启动
nohup jupyter notebook --allow-root > /app/jupyter_notebook/log/jupyter.log 2>&1 &
# 前台启动
# jupyter notebook --allow-root
http://192.168.187.200:8888/
密码:1234
python -m pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user --skip-running-check
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。