1.termux中安装Python

1.更新包


以下代码


apt update

apt upgrade

2.更新源


export EDITOR=vi

apt edit-sources

3.替换源


在vi编辑器里把第三行替换成以下内容(清华镜像源)


deb [arch=all,arm] http://mirrors.tuna.tsinghua.edu.cn/termux stable main

或者在清华源官网https://mirrors.tuna.tsinghua.edu.cn/找到替换源


sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.listsed -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.listsed -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.listapt update && apt upgrade


4.安装python2.7或3.0


2.7:pkg install python2

3.0:pkg instll python

替换升级pip版本


python2 -m pip install --upgrade pip

python -m pip install --upgrade pip

以上就是安装Python的具体方法


下一期:使用Python写简单程序:Hello word!


别忘了关注一下我呀!


点赞(。ò ∀ ó。)!

你可能感兴趣的:(1.termux中安装Python)