📓 如何在 Termux 上安装 Jupyter

本教程教你如何在 Termux 上安装 Jupyter Notebook / Lab,无需等待编译,直接使用预编译的 wheel 包。

⚡ 为什么要用预编译源?

❌ 不用预编译源(官方 PyPI)

$ pip install jupyter
Collecting jupyter
  Downloading jupyter-1.1.1.tar.gz
  Installing build dependencies ... 
  ⚠️ 编译依赖包(pyzmq, tornado 等)耗时极长,经常失败

结果:Jupyter 依赖链长,编译经常卡死 ⏱️

✅ 使用预编译源(本仓库)

$ pip install --index-url https://nsyhykui.github.io/python_wheels_for_termux/simple/ jupyter
Looking in indexes: https://nsyhykui.github.io/.../simple/
Collecting jupyter
  Downloading jupyter-1.1.1-py3-none-any.whl
Downloading pyzmq-26.4.1-cp313-cp313-android_24_arm64_v8a.whl (1.2 MB)
Downloading tornado-6.4.2-cp313-cp313-android_24_arm64_v8a.whl (437 kB)
Successfully installed jupyter-1.1.1 pyzmq-26.4.1 tornado-6.4.2 ...

real    1m30.123s

结果:不到 2 分钟装好 ✅

⚡ 一键设为默认源(以后不用再敲 --index-url)
pip config set global.index-url https://nsyhykui.github.io/python_wheels_for_termux/simple/
设置后,直接 pip install jupyter 即可。

📦 一行命令安装

pip install --index-url https://nsyhykui.github.io/python_wheels_for_termux/simple/ jupyter

或者只安装轻量版的 Notebook(不含 Lab):

pip install --index-url https://nsyhykui.github.io/python_wheels_for_termux/simple/ notebook
⚠️ 图形界面配置(重要)

Jupyter 会在本地打开浏览器窗口。在 Termux 中需要额外配置图形界面才能正常使用:

✅ 验证安装

python -c "import jupyter; print(jupyter.__version__)"

🔧 常见问题


🔗 ← 安装 NumPy | 安装 Pandas | 安装 SciPy | 安装 Matplotlib | 返回教程首页 | 包索引