安装

# root用户下操作
# 先安装python3和pip3
pip3 install jupyter

# 创建普通用户用于运行(坚持以root用户运行可以跳过这一步,执行下面的)
useradd leolan && passwd leolan
su leolan && cd ~
mkdir ~/.jupyter
export PATH=$PATH:~/.local/bin
echo 'export PATH=$PATH:~/.local/bin' >> ~/.bashrc
echo 'export PATH=$PATH:~/.local/bin' >> ~/.zshrc
jupyter notebook password  #设置密码

# 此处会生成配置文件.jupyter/jupyter_notebook_config.json
# 配置文件格式(JSON):{"NotebookApp": {"password": "sha1:175e8efe8974:eacef02a2e3f959d6efdf6c93d142c7f4712f5cc"}}
# 如果是docker或者自动服务等,可以用以下方式生成<登录密码的 sha1 加密版>
>>> from IPython.lib import passwd
>>> passwd()
Enter password: 
Verify password: 
'sha1:175e8efe8974:eacef02a2e3f959d6efdf6c93d142c7f4712f5cc'

# 执行脚本
如果是在deepin中
vim /home/leo/Desktop/Jupyter.desktop

[Desktop Entry]
Exec=/home/leo/.local/bin/jupyter notebook --port=9999
Icon=jupyter
Type=Application
Terminal=false
Name=jupyter
GenericName=jupyter
Categories=jupyter
Name[en_US]=jupyter
GenericName[en_US.UTF-8]=jupyter
Name[zh_CN]=jupyter

# 在服务器中
exit  #退出leolan,回到root用户
cd ~
vim start-jupyter.sh
#!/bin/bash
su - leolan -c 'nohup jupyter notebook --ip=0.0.0.0 --port=9999 &'

# 以root用户执行(不用新建用户、修改权限,加参数--allow-root即可)
nohup jupyter notebook --ip=0.0.0.0 --port=9999 --allow-root &

chmod +x start-jupyter.sh

# 最后防火墙放行端口

Docker

默认密码:123456
docker pull leolan/py2-py3-jupyter-scrapy-nginx

插件

**Jupyter Notebook 超实用的 5 个插件:**https://mp.weixin.qq.com/s/u-e66SgesPjmpKEihHHr8g
**99种扩展Jupyter功能的好方法:**https://mp.weixin.qq.com/s/2k8BcBEZ7dILaFYnrG2uTQ
**集成Go语言支持:**https://github.com/yunabe/lgo


资源

100 多个 Jupyter 精选资源:https://mp.weixin.qq.com/s/Ljo36772QTUDKuRrxIRmmw
Github:https://github.com/markusschanta/awesome-jupyter

文章作者: Leo
本文链接:
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 LeoLan的小站
Dev Python Jupyter Notebook
喜欢就支持一下吧