termux安装pandas和matplotlib(亲测可用)

@TOC

termux安装pandas

#安装python
pkg install python
#安装pandas,可以先pip安装一下numpy(非必须)
export CFLAGS="-Wno-deprecated-declarations -Wno-unreachable-code"
pip install pandas

Termux安装matplotlib

#Pillow库依赖
pkg install libjpeg-turbo
pkg install zlib
#matplotlib库依赖
pkg install cmake freetype libpng
pip install wheel
pip install kiwisolver cycler pyparsing python-dateutil 
#安装matplotlib
pip install matplotlib

用图说话

termux安装pandas和matplotlib(亲测可用)_第1张图片
安装pandas和matplotlib的过程会很漫长,大概都超过了20min(也可能是我手机太辣鸡,穷逼落泪)。建议termux换用国内源,比如清华源。此外,实践发现虽然使用的是国内源,但是科学上网(VPN)后,下载速度会快很多(但是安装速度依然巨慢)。

献上termux换源方法

自动换源:

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

sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list

sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list

pkg update

手动换源:

#用vi/vim/nano/Emacs等编辑器在termux内部修改
vim $PREFIX/etc/apt/sources.list
# 以清华源为例,把sources.list修改为如下内容:
deb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable

https://github.com/termux/termux-packages/issues/2231
https://zhuanlan.zhihu.com/p/146555866
https://www.sqlsec.com/2018/05/termux.html#toc-heading-17
https://www.bilibili.com/video/av94284606
https://blog.csdn.net/weixin_45406671/article/details/107829480

你可能感兴趣的:(termux,python,android)