Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to run Python 3.8.x on Termux on Android, currently installed with Python 3.9

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?

like image 330
deldridg Avatar asked Oct 24 '25 04:10

deldridg


1 Answers

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_<CPU_ARCH.>.deb?raw=true
  1. Finally, execute the following command in termux:
dpkg -i ./python_3.8.6_<CPU_ARCH.>.deb

Once again, replacing <CPU_ARCH.> 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.

like image 167
Joe Boyle Avatar answered Oct 25 '25 18:10

Joe Boyle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!