How to Install Python in Termux 2024?

As, Python is a well-loved programming language that is used for various purposes, like data analysis, web development, and machine learning. Sometimes, we want to use it on our Android device. With the help of  Termux, we can easily use python on our Android device. So, If you want to know how to install python in Termux just follow the steps outlined in this article.

Requirements

Before you proceed further, make sure you have the following things -

1. An Android device with Termux installed, download it from here

2. A good working internet connection

3. And lastly some patience

Steps to Install Python in Termux

Just follow the following steps to install Python in Termux:

1. Firstly, Open Termux on your Android device and update the package list by running the following command:

apt update


2. Now, we have to upgrade the package. For that, run the following command to do so:

apt upgrade


3. Now,  to install Python type the following command:

apt install python

4. If you want to install python2 on your android mobile just type the following command:

apt install python2

5.  If you want to install python3 then for that, type the following command:

apt install python3


Verification

To verify that Python is installed successfully, run the following command:

1. For python :

python -v


2. For python2

python2 -v


3. For python3

python3 -v

If everything went smoothly, you should see the version of Python that you have installed.

Final Notes

And that's it! You have successfully installed Python in Termux. With Python, you can accomplish many things, and Termux provides a convenient environment to use it on your Android device. Whether you're a beginner or an experienced programmer, you can use Python in Termux to achieve your goals. So go ahead, start exploring, and have fun!

Thank You For Reading!

Related Content