Home  >  Article  >  Backend Development  >  How to install python in termux

How to install python in termux

(*-*)浩
(*-*)浩Original
2019-06-27 14:44:3025899browse

Termux is an advanced terminal emulator for Android. It is open source and does not require root. It supports apt management software packages. It is very convenient to install software packages. It perfectly supports Python, PHP, Ruby, Go, Nodejs, MySQL, etc. With the popularity of smart devices and the continuous improvement of their performance, the hardware standards of today's mobile phones, tablets, etc. have reached the hardware standards of primary desktop computers. If you build it carefully, you can turn your mobile phone into a powerful tool.

How to install python in termux

Installation of Python in Termux (Recommended learning: Python video tutorial)

1. Update package

apt update
apt upgrade

2. Modify the source

export EDITOR=vi
apt edit-sources

In the vi editor, replace the second line with the following content (Tsinghua mirror source)

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

In the vi editor, enter the first i enters the editing mode (insert), and the prompt "INSERT" will be given below. If you type again at this time, you will insert characters to the left of the cursor. After the modification is completed, press and hold the volume up and enter e at the same time to exit the editing mode. Then enter: wq to save and exit vi.

Install python2.7

pkg install python2

After the installation is complete, use the python2 command to start the python 2.7.14 environment.

Install python3

pkg instll python

After the installation is complete, use the python command to start the python 3.6.5 environment.

Upgrade the pip version

python2 -m pip install --upgrade pip 
python -m pip install --upgrade pip

These two commands are upgraded separately Updated pip2 and pip3 to the latest version.

For more Python related technical articles, please visit the Python Tutorial column to learn!

The above is the detailed content of How to install python in termux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn