How do i update python in termux?

I have just installed the latest Termux on my Android device and Python 3.9 is the default Python installation. I need to run Python 3.8.x due to some package incompatibilities.

My searching tells me there is no way to downgrade Python within Termux - is this correct?

If I install a previous version of Termux, will this in turn install an earlier version of Python or will it just collect the same default version?

Is there another way for me to make this change?

asked Nov 16, 2020 at 6:50

1

I've encountered something similar over the past few days!

Here is a summary of the solution given by @kcubeterm on Reddit, who has very kindly provided a way to install python 3.8X on Termux.

  1. Remove python 3.9 if you have it installed:
pkg uninstall python
  1. Make a note of the architecture of your device's CPU using this command:
uname -m
  1. Go to https://github.com/Termux-pod/termux-pod and find the file corresponding to your device's CPU. According to @kcubeterm, you should try python_3.8.6_.deb first and then the static version if there is any error.

  2. Download the raw .deb file in termux using web-get.

make sure you add ?raw=true to the end of the url, or else you'll end up downloading the html file!

wget https://github.com/Termux-pod/termux-pod/blob/main/arm/python/python_3.8.6_.deb?raw=true
  1. Finally, execute the following command in termux:
dpkg -i ./python_3.8.6_.deb

Once again, replacing with your cpu's architecture (for me it was arm).

Hope this answer helped you to install Python 3.8! I love termux but find it frustrating that they provide no way to install non-bleeding edge versions of packages!

Thanks again to @kcubeterm who provided this solution.

answered Nov 19, 2020 at 16:18

How do i update python in termux?

Joe BoyleJoe Boyle

972 silver badges4 bronze badges

1

git clone the termux-packages repo

then cd to the packages/python folder git log build.sh to find the commit with the version you want checkout that commit (for the entire repo, to be sure)

then follow the standard instructions at https://wiki.termux.com/wiki/Building_packages

Otherwise you don't know what kind of binary you are installing. Build it yourself to be sure. I'd wanna be sure.

answered Jan 11, 2021 at 18:05

How do i update python in termux?

Mike AmyMike Amy

3513 silver badges4 bronze badges

It doesn't depends upon the Version of termux. It depends upon the repository. And it always update it's packages . So i think there is no way

answered Nov 16, 2020 at 7:04

How do i update python in termux?

install pypy3 using apt

# apt search python

.
.
.
pypy/stable 7.3.9-1 aarch64
  A fast, compliant alternative implementation of Python
.
.
.

# pypy3 --version
Python 3.8.13 (4b1398fe9d76ad762155d03684c2a153d230b2ef, Apr 25 2022, 09:26:53)
[PyPy 7.3.9 with GCC Clang 14.0.1]

answered Jun 23 at 10:49

How do i update python in termux?

M.DM.D

691 gold badge2 silver badges11 bronze badges

Skip to content

Today,I am gonna share how to use Python in Termux app on Android phone without need of rooting . It’s very simple and easy way to use Python. Thanks to the developer of Termux , Fredrik Fornwall.

Python v3 installation : 

1.Open Termux app and type this command:

apt install python 

How do i update python in termux?

2.Now type y if you want to proceed.Otherwise n .

3.After successful installation, you can use Python by using this command:

python 

How do i update python in termux?

Python v2 installation :

1.Use this command to install python2 :

apt install python2

How do i update python in termux?

2.To run python2, use this command: python2

I hope this post will be useful to them who want to use Python v3 and v2 without need of rooting Android phone.

Thanks : Minakshi

Thanks to my family.

A computer science engineering student.My hobby is programming and reading novels. View all posts by gauravssnl

Post navigation

How do I manually update python?

Follow the below steps to update your python version:.
Step 1: Go to Python's official site..
Step 2: Click on the Downloads tab..
Step 3: Download the version you need to upgrade to based on your system specifications(ie, 32-bit or 64-bit). ... .
Step 4: Click on the installer and it will begin the installation..

How do I update python 2 in termux?

To use python2, you need to type python2 example.py . This way, you can specifically tell Termux to use python2 instead of the default python3 version. The same goes for pip, if you use pip install example , this will automatically use pip version 3 to install packages.

Can I run python on termux?

A few python packages are available from termux's package manager (for python3 only), and should be installed from there to avoid compilation errors. This is the case for: numpy, pkg install python-numpy. electrum, pkg install electrum.