How to install python in termux

(*-*)浩
Release: 2019-07-09 10:14:02
Original
25984 people have browsed it

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
Copy after login

2. Modify the source

export EDITOR=vi
apt edit-sources
Copy after login

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
Copy after login

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
Copy after login

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

Install python3

pkg instll python
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!