Jupyter配置

Jupyter配置

Termux下

安装 libzmq

之前报错就是因为没有libzmq,pip安装的时候没法编译

1
apt install libzmq

安装jupyter

1
pip install jupyter

生成配置文件

1
jupyter notebook --generate-config

默认生成在 ~/.jupytercd ~/.jupyter

使用 ipython 生成密匙

1
2
from notebook.auth import passwd
passwd()

按提示输入密码,复制生成的字符串(例如’sha1:aabbcc00’)

编辑 jupyter_notebook_config.py 添加刚刚生成的密匙

1
2
3
4
5
6
7
8
c.NotebookApp.password = 'sha1:aabbcc00'
# 允许任何ip访问
c.NotebookApp.ip='*'
# 禁用自启动浏览器
c.NotebookApp.open_browser = False
# 设置端口
c.NotebookApp.port =8888

(以下为个人配置)设置别名

1
2
3
mkdir ~/.jupyter/leo
vi ~/.zshrc
alias myjupyter="jupyter notebook --notebook-dir /data/data/com.termux/files/home/.jupyter/leo & sleep 1; termux-open http://127.0.0.1:8880”

安装插件

1
pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install

plugins


Jupyter配置
https://leo03w.github.io/2022/09/23/Jupyter配置/
作者
Leo
发布于
2022年9月23日
许可协议