-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
71 lines (55 loc) · 1.97 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# 提醒用户更新Termux软件包
echo "更新Termux软件包..."
pkg update && pkg upgrade
# 更换软件源为清华大学镜像
echo "更换软件源为清华大学镜像..."
sed -i 's@^deb.*stable main$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
pkg update
# 添加TUR的软件仓库
echo "添加TUR的软件仓库..."
pkg install tur-repo && pkg upgrade
# 安装Python
echo "安装Python..."
pkg install python
# 安装NumPy
echo "安装NumPy..."
pkg install python-numpy
# 安装Pandas
echo "安装Pandas..."
pkg install python-pandas
# 安装Jupyter所需依赖
echo "安装Jupyter所需依赖..."
pkg install rust
pkg install binutils-is-llvm
cargo install maturin
pkg install libzmq libcrypt pkg-config -y
pkg install clang fftw make freetype -y
pip install ipython
# 安装特定版本的pyzmq以避免兼容性问题
echo "安装特定版本的pyzmq以避免兼容性问题..."
pip install pyzmq==25.1.1
pip install rpds-py
pip install jupyter
# 安装Matplotlib及其依赖
echo "安装Matplotlib及其依赖..."
pkg install -y libjpeg-turbo libtiff
pkg install python-pillow
pkg install -y libpng
pkg install matplotlib
# 配置Matplotlib以支持中文显示
#echo "配置Matplotlib以支持中文显示..."
# 替换为您下载的中文字体文件路径
#cp -i simsunb.ttf /data/data/com.termux/files/usr/share/fonts/truetype/ || echo "字体文件复制失败,请手动复制"
#fc-cache -f -v
# 编辑matplotlib配置文件以使用中文字体
#sed -i 's/#font.sans-serif :.*/font.sans-serif : simsunb/g' /data/data/com.termux/files/usr/lib/python3.11/site-packages/matplotlib/mpl-data/matplotlibrc
# 清除matplotlib缓存
#echo "清除matplotlib缓存..."
#rm -rf ~/.cache/matplotlib
# 安装成功提示
echo "安装完成!"
# 启动Jupyter Notebook
echo "启动Jupyter Notebook..."
jupyter notebook
# 注意:在启动Jupyter Notebook之前,请确保Termux具有后台运行权限。