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
🌐
Python
python.org › downloads
Download Python | Python.org
Installer packages for Python on macOS downloadable from python.org are signed with with an Apple Developer ID Installer certificate.
Discussions

cmd - How to install Python using Windows Command Prompt - Stack Overflow
Is it possible to install Python from cmd on Windows? If so, how to do it? More on stackoverflow.com
🌐 stackoverflow.com
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
How SHOULD you install Python on Mac OS?
I use brew to install ‘pyenv’ and ‘pipenv’. From there I use pyenv to manage the Python version and pipenv for packages and virtual environments. On top of all that, I have OhMyZsh integration that automatically runs ‘pipenv shell’ when I enter a directory with a pipenv virtual environment defined. Works very nicely and integrates well with VS Code, too. Addendum: By doing it this way, I don’t ever touch the system Python installed by Apple. A lot less complications that way. More on reddit.com
🌐 r/learnpython
67
47
April 18, 2025
How to update Python version in Terminal? - Stack Overflow
I've updated my version of Python to 3.11, but Terminal is printing different versions, depending on what command I enter. Entering python3 --version prints Python 3.9.13. Entering python --version prints Python 3.9.6. When I go to the actual Python framework, I can see that 3.11 is installed and ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Real Python
realpython.com › installing-python
How to Install Python on Your System: A Guide – Real Python
February 18, 2026 - After you’ve selected the Python Install Manager app, follow these steps to complete the installation: Click the Get button. Wait for the app to download. Click the Open button. When you click the Open button, you’ll be presented with a terminal window.
🌐
Python Packaging
packaging.python.org › tutorials › installing-packages
Installing Packages — Python Packaging User Guide
You should get some output like ... to the Installing Python section of the Hitchhiker’s Guide to Python. ... >>> python --version Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'python' is not defined · It’s because this command and other suggested commands in this tutorial are intended to be run in a shell (also called a terminal or ...
🌐
GitHub
github.com › PackeTsar › Install-Python
GitHub - PackeTsar/Install-Python: Quick Guide for Installing Python on Common Operating Systems · GitHub
There are a couple of ways we can ... Profile.command file to run each of them ... Open your Terminal application and run the command python3 to enter the Python interactive ......
Starred by 2 users
Forked by 7 users
Find elsewhere
🌐
Visual Studio Code
code.visualstudio.com › docs › python › python-tutorial
Getting Started with Python in VS Code
November 3, 2021 - To install the required packages ... Anaconda distributions because they include matplotlib already. # macOS python3 -m pip install numpy # Windows (may require elevation) python -m pip install numpy # Linux (Debian) apt-get ...
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

🌐
Thegraphcourses
thegraphcourses.org › courses › python-dev › topics › installing-python-3-12-0
Installing Python 3.12.0 – The GRAPH Courses
I’ve successfully installed Python. Good job! @Марта-Божена Синов'ят Kene ... That’s a bit surprising. ... But there is no “mini” version of Python that I know of unfortunately. ... Okay I think this is not needed for Python but for command line developer tools, which may not be entirely necessary. You can close your Terminal ...
🌐
Python Land
python.land › home › install python: detailed instructions for window, mac, and linux
Install Python: Detailed Instructions for Window, Mac, and Linux • Python Land Tutorial
October 1, 2024 - Since it’s the official Python distribution, it’s well-tested, and it will be easier to ask for help if needed. When you use this installer, mark the checkboxes that say ‘Add Python to PATH’ and ‘Install launcher’ as seen below:
🌐
GeeksforGeeks
geeksforgeeks.org › download-and-install-python-3-latest-version
Download and Install Python 3 Latest Version - GeeksforGeeks
To install Python simply open the Terminal app from Application -> Utilities and enter the following command
Published   April 7, 2025
🌐
Astral
docs.astral.sh › uv › guides › install-python
Installing and managing Python | uv
July 17, 2025 - A guide to using uv to install Python, including requesting specific versions, automatic installation, viewing installed versions, and more.
🌐
Python documentation
docs.python.org › 3 › using › mac.html
5. Using Python on macOS — Python 3.14.3 documentation
Double-click on the Install Certificates.command icon or file in the /Applications/Python 3.14/ window to complete the installation. This will open a temporary Terminal shell window that will use the new Python to download and install SSL root certificates for its use.
🌐
pip
pip.pypa.io › en › stable › installation
Installation - pip documentation v26.0.1
This is a Python script that uses some bootstrapping logic to install pip. Download the script, from https://bootstrap.pypa.io/get-pip.py. Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run: Linux · $ python get-pip.py MacOS ·
🌐
YouTube
youtube.com › watch
How to Install Python Latest Version on Linux | Complete ...
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-install-python-on-linux
How to Install Python on Linux - GeeksforGeeks
July 12, 2025 - If you accepted this during installation, it should be done automatically. If not, you can run: ... Modifies your shell configuration file to activate the Conda environment automatically. Ensures Conda commands like conda activate and conda deactivate work without additional configuration. Then, restart your terminal or run source ~/.bashrc (or source ~/.zshrc if you're using Zsh). Create a new environment with a specific version of Python (for example, Python 3.13)
🌐
Reddit
reddit.com › r/learnpython › how should you install python on mac os?
r/learnpython on Reddit: How SHOULD you install Python on Mac OS?
April 18, 2025 -

What do you think is the best way to install and maintain python and Jupyter lab on Mac in 2025?

It’s a mess on my current machine. Quickly running python in a terminal for a quick job uses a different version with different packages than Jupyter lab. Typing “python3” in the terminal doesn’t default to the most recent. At some point anaconda was installed.

What’s the cleanest way for a new machine to have an organized python environment? 90% of what I do is in Jupyter lab.

Top answer
1 of 5
6

A terminal in a unix-based OS (including Darwin / MacOS and Linux) will search for the command you have typed in several places, in order, and the first match found will stop the search from finding other possible commands with the same name.

To simplify the answer, I'll limit this to the bash shell as I don't use ZSH, but I think the answer should be similar in both shells.

After you type in a line of input and hit enter, your shell will modify its input so that it expands variable interpolations and such things and then will take the first token (first "word") and search for that word as a command name.

Commands can be found in several places, from builtin commands, to aliases, to shell functions and if the command can't be found there, the shell will begin looking at specific locations in your filesystem to look for files that are named the same as your command. The first match wins, so if you have several pythons in your PATH, the first one will be the one that is selected.

The set of locations in your filesystem the shell will look for the command is stored in an environment variable called PATH in the shell and is generally available to view and set.

to see what your path is:

echo ${PATH}

or. for slightly easier reading:

echo ${PATH} | sed 's/:/\n/g'

which python will let you see what python version your shell is finding first in the PATH and type python will let you know if for some reason you have a function or alias named python that happens to overshadow your filesystem python executables.

Also, bash maintains an internal hash table of where it has previously found commands. So if you type python and bash finds it in /usr/bin/python, then it will remember that for the rest of the session. If you'd like it to look again, because perhaps you have installed a new python you expect it to find first, you can type hash -r to reset the hash table to a blank new one.

All that being said, if you are starting to develop in Python, you're going to need to handle different versions of Python.

To start down that road, check out:

  • asdf
  • pyenv

I recommend asdf as it can work for many things, not just python. Also, you'll probably want a decent dependency manager sooner rather than later for your project, so I'd check out poetry and pipenv:

  • Poetry
  • Pipenv
2 of 5
2

I just had the same problem and I'm sharing this in case this helps anyone else. Note: I am on a Windows computer. Initially, I thought all I had to do was download the newest version of Python from the website. However, my terminal was printing:

python --version Python 3.12.1

python3 --version Python 3.10.3

py --version Python 3.13.1

So the first thing I did was type scoop install python because I thought it might be a problem with that command line installer. But even when I did that, it was now printing out:

python --version Python 3.12.1

python3 --version Python 3.13.1

py --version Python 3.13.1

So eventually I made my way to my environment variables and removed an install of Python 3.12 from my PATH for my local user profile. Now all versions of Python correctly print their intended version!

python --version Python 3.13.1

python3 --version Python 3.13.1

py --version Python 3.13.1