Python is installed to all of our computers because it is useful framework for a variety of things .

To use the python interface from terminal just type python .

to check you python version just type python --version

to run a python script you need to type in the form :

./python_script_name.py

but very importantly it has to be executable first

chmod +x python_script_name.py

I hope it helps !

Answer from billybadass on askubuntu.com
🌐
Reddit
reddit.com › r/ubuntu › how do i install python?
r/Ubuntu on Reddit: How do I install python?
February 25, 2021 -

Hey Reddit. I'm super new to ubuntu. (like 3 days ago I got my first machine running it.) and need some quick help. I want to install python so I can run code on the machine and I have no idea how to do that. I'm guessing it'll be something like "sudo install python3.9". thanks for the help!

Discussions

How to download and use python on ubuntu? - Stack Overflow
by Default python install in ubuntu so you check version by typing in terminal(Ctrl+Alt+T) python3 -V if show older version then configure it type in terminal More on stackoverflow.com
🌐 stackoverflow.com
Install python 3.11.9 on ubuntu
According to this page: 'Python 3.11.9 is the newest major release of the Python programming language". Can I install Python 3.11.9 in my Virtual Machine? I have installed guest VM ubuntu-22.04.4-desktop-amd64.iso on a Windows 10 host. In the VM, I have run the following: sudo apt install sudo ... More on discuss.python.org
🌐 discuss.python.org
0
1
April 16, 2024
How can I install Python 3.9 on a Linux Ubuntu terminal? - Stack Overflow
I tried apt install python 3.9 and it replied: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3.9 E: Couldn't find any pa... More on stackoverflow.com
🌐 stackoverflow.com
[Ubuntu/Linux, default python 3.10.4] best way to install Python 3.8 and create venv with it?
i have used conda to generate python2+ envs under python3+ so it should be able to handle 3.8 from 3.10 https://i.imgur.com/AQ3kBh4.png https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf More on reddit.com
🌐 r/learnpython
7
1
June 13, 2022
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › starting › install3 › linux
Installing Python 3 on Linux — The Hitchhiker's Guide to Python
$ sudo apt-get update $ sudo apt-get install python3.6 · If you’re using another version of Ubuntu (e.g.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install python 3 on ubuntu
How to Install Python 3 on Ubuntu | phoenixNAP KB
June 12, 2025 - In this tutorial, you will learn how to install Python 3 on Ubuntu. ... A system running Ubuntu (this tutorial uses Ubuntu 22.04 or Ubuntu 24.04). A user account with sudo or root privileges. Access to the terminal.
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-python-in-ubuntu
How to install Python in Ubuntu (3 Methods to install ) - GeeksforGeeks
July 23, 2025 - Now, directly paste the following command in the Terminal & execute it. It will directly download the latest Python File. ... Replace [version number] with the Python version you want to be installed in your Ubuntu system.
🌐
Beebom
beebom.com › how-install-python-ubuntu-linux
How to Install Python in Ubuntu Linux (4 Methods) | Beebom
October 15, 2025 - But bear in mind, it’s a slightly ... specs. Here are the steps you need to follow. 1. First, open the Terminal and run the below command to update the packages....
Find elsewhere
🌐
Python.org
discuss.python.org › python help
Install python 3.11.9 on ubuntu - Python Help - Discussions on Python.org
In the VM, I have run the following: sudo apt install sudo apt upgrade this: python3 --version returns: Python 3.10.12 When I run: sudo apt install python3 I receive this message: python3 is already at the newest version (3.10.6-1~22.04) When...
Published   April 16, 2024
🌐
MakeUseOf
makeuseof.com › home › linux › how to install python in ubuntu [3.12]
How to Install Python in Ubuntu [3.12]
June 30, 2023 - Here's how to do it: Open up your terminal by pressing Ctrl + Alt + T. Update your system's repository list by entering the following command: ... APT will automatically find the package and install it on your computer.
🌐
Linux Hint
linuxhint.com › install-python-ubuntu-22-04
How to Install Python on Ubuntu 22.04? – Linux Hint
After that, run the following command to install the Ubuntu-Desktop package to have the GUI and the CLI support on your Ubuntu 22.04: ... Log in to the system and run the following command to verify the availability of the default Python3:
Top answer
1 of 3
84

If you are on Ubuntu 19.10 (Eoan Ermine) (or any other version unsupported by the deadsnakes PPA), you will not be able to install using the deadsnakes PPA.

What you can do instead, is get the source from Python's official website, and install it manually, as described here.

To do so, first, install the dependencies required to build the Python package.

sudo apt install build-essential zlib1g-dev \
libncurses5-dev libgdbm-dev libnss3-dev \
libssl-dev libreadline-dev libffi-dev curl software-properties-common

Then download the tarball and extract it:

wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
tar -xf Python-3.9.0.tar.xz

Then cd to the extracted directory:

cd Python-3.9.0

Now configure the script:

./configure

Now, to install Python 3.9 alongside your current Python installation (if any), use:

sudo make altinstall

Lastly, you can verify your installation using

python3.9 --version

How to make python3.X default of Python 3? (Optional)

rm /usr/bin/python3
ln -s /usr/bin/python3.5 /usr/bin/python3
  • create an alias in ~/.bash_aliases, ~/.zshrc, etc.
alias python3='/usr/bin/python3.9'

or

alias python3='/usr/local/bin/python3.9'
2 of 3
41

You are getting that error because you first need to update the package list and the prerequisites.

sudo apt update
sudo apt install software-properties-common

Then, add the repository ppa:deadsnakes/ppa to your sources list (where you will download Python from)

sudo add-apt-repository ppa:deadsnakes/ppa

Make sure to press Enter when prompted. Then update available the packages:

sudo apt update

Lastly, install the version of your choice:

sudo apt install python3.9

Make sure to read this:

Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk.

PPA Deadsnake

🌐
BitLaunch
bitlaunch.io › blog › how-to-install-python-on-ubuntu
7 Ways to Install and Manage Python and Python3 on Ubuntu
December 17, 2025 - On Ubuntu, the easiest and officially recommended way is to install the python-is-python3 package. After opening the terminal, run the following command:
🌐
Medium
medium.com › @pythonistaSage › installing-and-using-python-on-ubuntu-a-guided-tutorial-c4ab0eda33a3
Installing and Using Python on Ubuntu: A Guided Tutorial | by PythonistaSage | Medium
March 25, 2023 - Pip is a package manager for Python that allows you to easily install and manage Python packages. To install pip on Ubuntu, open the terminal and type the following command:
🌐
BlueVPS
bluevps.com › blog › how to install python on ubuntu 22.04? (a complete step-by-step guide)
How to Install Python on Ubuntu 22.04
To install Python3 on Ubuntu using the deadsnakes PPA repository, follow the below steps: Open a terminal and run the following command to update your package lists:
🌐
ComputingForGeeks
computingforgeeks.com › home › how to install python 3.10 on ubuntu 22.04|20.04|18.04
How To Install Python 3.10 on Ubuntu 22.04|20.04|18.04 [Guide]
September 27, 2024 - Step-by-step guide to install Python 3.10 on Ubuntu 22.04|20.04|18.04. Includes commands, verification, and troubleshooting.
🌐
UltaHost
ultahost.com › knowledge-base › install-python-ubuntu
How to Install Python on Ubuntu | Ultahost Knowledge Base
April 13, 2025 - You can find the latest version by downloading the compressed file for Ubuntu. After downloading place the folder in the directory and access them from the terminal. ... After building the essentials, Use the APT command to install Python.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-20-04-server
How To Install Python 3 and Set Up a Programming Environment on an Ubuntu 20.04 Server | DigitalOcean
April 4, 2022 - If you’re not already familiar ... useful for becoming better oriented with the terminal. With your server and user set up, you are ready to begin. Ubuntu 20.04 and other versions of Debian Linux ship with Python 3 pre-installed....
🌐
UbuntuHandbook
ubuntuhandbook.org › home › howtos › how to install python 3.12 (final) in ubuntu 22.04 | 20.04
How to Install Python 3.12 (Final) in Ubuntu 22.04 | 20.04 | UbuntuHandbook
1. First download the source tarball from its ftp download page: ... 2. Then open ‘Downloads’ folder, extract the source tarball, finally right-click on source folder and select “Open in Terminal”. 3. When terminal opens, run the commands below one by one to configure and build Python: ...
🌐
Opensource.com
opensource.com › article › 20 › 4 › install-python-linux
How to install Python on Linux | Opensource.com
April 13, 2020 - Once the Python tarball has been extracted, navigate to the configure script and execute it in your Linux terminal with: ... The configuration may take some time. Wait until it is successfully finishes before proceeding. If you already have a version of Python installed on your system and you want to install the new version alongside it, use this command:
🌐
Linuxize
linuxize.com › home › python › how to install python 3.9 on ubuntu 20.04
How to Install Python 3.9 on Ubuntu 20.04 | Linuxize
November 15, 2020 - Terminal · python3.9 --version · output · Python 3.9.1+ That’s it. Python 3.9 is installed on your Ubuntu, and you can start using it. Compiling Python from the source allows you to install the latest Python version and customize the build options. However, you won’t be able to maintain your Python installation through the apt package manager.