Termux 是一款运行在 Android 系统的 Linux 终端模拟器,无需 root 即可使用。
在使用 Termux 的时候发现无法安装 Python 的 Scipy 库,网上找了一大圈没找到解决办法,最后在Termux官网找到了解决办法。具体方法如下:
安装 wget
1
$ pkg install wget
利用 wget 下载 setup-pointless-repo.sh 文件
1
$ wget https://its-pointless.github.io/setup-pointless-repo.sh
执行下载好的 setup-pointless-repo.sh 文件
1
$ bash setup-pointless-repo.sh
安装 Scipy / Numpy 库
1
2$ pkg install scipy
$ pkg install numpy测试安装是否成功
1
2$ python -c 'import scipy'
$ python -c 'import numpy'删除安装过程中下载的文件
1
2$ rm pointless.gpg
$ rm setup-pointless-repo.sh
附: setup-pointless-repo.sh 文件内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Get some needed tools. coreutils for mkdir command, gnugp for the signing key, and apt-transport-https to actually connect to the repo
apt-get update
apt-get --assume-yes upgrade
apt-get --assume-yes install coreutils gnupg2 wget
# Make the sources.list.d directory
mkdir $PREFIX/etc/apt/sources.list.d
# Write the needed source file
echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list
# Download signing key from https://its-pointless.github.io/pointless.gpg
wget https://its-pointless.github.io/pointless.gpg
apt-key add pointless.gpg
# Update apt
apt update