Install Python on Android with Termux

Posted: 4/17/2026 | Updated: April 17, 2026

This guide covers installing Python on Android using Termux and includes a few practical notes from testing the process on a phone.

Step 1: Install Termux

Download Termux from Google Play, F-Droid, or from the Termux GitHub releases page.

Step 2: Update packages

Open Termux and run:

pkg update && pkg upgrade

This refreshes the package list and brings the current Termux environment up to date.

Step 3: Install Python

Run:

pkg install python

Type y and press Enter when prompted to confirm the download.

Step 4: Verify installation

Check that Python is installed correctly:

python --version

It should return the current version number, for example Python 3.12.x.

Additional setup

  • PIP package manager is available automatically after installing Python.
  • If you want to compile Python modules or install packages with native extensions, install the build tools:
pkg install build-essential

Storage access

To allow Python scripts to read and write files on your phone's internal storage, run:

termux-setup-storage

I always run this immediately after installation. Once the storage permission is granted, you avoid the later surprise of scripts failing because they cannot access /sdcard.

Pro tip: if you ever need to install a package that uses native extensions, doing the build-essential step first saves you a second round of package installs.

See also

Frequently asked questions

Yes. The `python` package includes pip automatically, so you can install libraries with `pip install` right away.