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
Discussions

Installing python on Linux - help?
You should stick with your distros version and only do a manual installation if not possible otherwise. If you really need to do it, have a look here: https://aruljohn.com/blog/install-python-debian/ More on reddit.com
🌐 r/learnpython
16
8
May 26, 2024
Python 3 installation on windows running from command line - Stack Overflow
Just curious, is there a particular reason why Python 3.x is not installed on Windows to run default with the command line "python3", like it does on Mac OSX and Linux? Is there some kind of way to 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
New pc: how do I install python *correctly* this time?
Perfectly fine to use Windows, that's my personal preference (combined with WSL). I usually recommend using the standard Python installation, but if you're focused on doing data science Anaconda is technically a better fit. I'm going to assume you want a more generalised setup, so I'm going to explain the first one. Correct me later if you so wish. So, simply go to python.org and download the latest version, or at least 3.9 if you're not sure what you need supports 3.10 yet. When you run the installer, to make stuff easier in the beginning check the box to add Python to PATH, then just let the installer do its thing. Finally, once installed, check the box to disable the path length limit just in case - you probably won't need it, but it doesn't hurt. And that should be everything done for the basics. Virtual environments aren't a hard requirement on Windows if you ask me, but it's probably a good idea to get used to them. Personally I recommend using Poetry so that you don't have to worry about it at all yourself and because it's very modern, but you can get by without anything or by using the built-in venv if you so wish. Since Python was added to PATH, you should have direct access to running python, pip, and any tools you might install via PyPI directly. If you didn't, you'd use them via the included py-launcher. py -m pip That is all. Use whatever editor you fancy, I like VS Code with Python but you should try out different ones and find one you like yourself. More on reddit.com
🌐 r/learnpython
34
34
October 30, 2021
🌐
Real Python
realpython.com › installing-python
How to Install Python on Your System: A Guide – Real Python
February 18, 2026 - Once the installation is complete, you’ll be back at the shell prompt in your terminal window. Note: If you’re doing this on a fresh install of macOS, you may get a pop-up alert asking you to install Apple’s command line developer tools. These tools are necessary for installation, so you can confirm the dialog box by clicking Install. After the developer tools are installed, you’ll need to press Enter to continue installing Homebrew. Now that Homebrew is installed, you’re ready to install Python.
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.14.3 documentation
To install the file downloaded from python.org, either double-click and select “Install”, or run Add-AppxPackage <path to MSIX> in Windows Powershell. After installation, the python, py, and pymanager commands should be available.
🌐
Python Packaging
packaging.python.org › guides › installing-stand-alone-command-line-tools
Installing stand alone command line tools — Python Packaging User Guide
ensurepath ensures that the application directory is on your $PATH. You may need to restart your terminal for this update to take effect. Now you can install packages with pipx install and run the package’s applications(s) from anywhere.
🌐
Python Packaging
packaging.python.org › tutorials › installing-packages
Installing Packages — Python Packaging User Guide
Note that the --user flag has no effect when inside a virtual environment - all installation commands will affect the virtual environment. If SomeProject defines any command-line scripts or console entry points, --user will cause them to be installed inside the user base’s binary directory, which may or may not already be present in your shell’s PATH.
Find elsewhere
🌐
Pluralsight
pluralsight.com › tech insights & how-to guides › software development
How to install Python: The complete Python programmer's guide | Pluralsight
May 2, 2024 - This command installs Python 3 and Pip3. Pip3 is the Python package installer you’ll need when using Python. After installing Python, we can check to see if we installed it correctly. Close the terminal you opened and open a new one.
🌐
CodeRivers
coderivers.org › blog › install-python-command-line
Installing Python via the Command Line: A Comprehensive Guide - CodeRivers
April 23, 2025 - Different operating systems have their own command line interfaces, such as Command Prompt and PowerShell on Windows, Terminal on macOS, and various shells (e.g., Bash) on Linux. Installing Python via the command line offers several advantages: - Flexibility: You have more control over the installation process, allowing you to choose specific versions of Python and manage dependencies.
🌐
Dataquest
dataquest.io › blog › installing-python-on-windows
How to Install Python on Windows, from Downloading to Running Scripts (2022)
March 14, 2025 - To do so, open the command line application Command Prompt (in Windows search, type cmd and press Enter) or Windows PowerShell (right-click on the Start button and select Windows PowerShell) and type there python -V. If you found that Python ...
🌐
Python
docs.python.org › 3 › installing › index.html
Installing Python Modules — Python 3.14.3 documentation
At this point in time, it will often be easier for users to install these packages by other means rather than attempting to install them with pip. ... On Linux, macOS, and other POSIX systems, use the versioned Python commands in combination with the -m switch to run the appropriate copy of pip:
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-install-python-on-linux
How to Install Python on Linux - GeeksforGeeks
July 12, 2025 - Here’s a step-by-step guide to installing Python using Miniconda on a Linux system. Open your terminal. Download the Miniconda installer for Linux. You can use wget or curl. For example: wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh · It's a good practice to verify the integrity of the installer. You can find the hash values on the Miniconda website. Use the following command to check:
🌐
DataCamp
datacamp.com › blog › how-to-install-python
How to Install Python on Mac and Windows | DataCamp
December 4, 2024 - To install Python, follow the instructions in one of the previous sections (such as downloading and installing from the website using the Microsoft Store). To install a package using pip3, open a Terminal on macOS or Command Prompt on Windows and type the following command:
🌐
PythonTest
pythontest.com › python › installing-python-3-14
Installing Python 3.14 on Mac or Windows | PythonTest
Run the installer. That’s it. Done. I just did this on my Mac mini and timed it. ... Run python3 --version to verify that the new version was installed.
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › dev-environment › python
Python on Windows for beginners | Microsoft Learn
February 26, 2026 - This package can be installed easily, without administrator permissions, and will replace the default python and python3 commands with the real ones. Running the shortcut executable with any command-line arguments will return an error code to indicate that Python was not installed.
🌐
W3Schools
w3schools.com › python › python_getstarted.asp
Python Getting Started
To check if Python is installed on Windows, search in the start bar for Python or run the following on the Command Line (cmd.exe):
🌐
Heicodersacademy
heicodersacademy.com › blog › how-to-install-python
How to Install Python on Windows, Mac and Linux
Read the latest insights and tips related to AI, python programming, data science, tech careers & more.
🌐
Dive into Python
diveintopython.org › home › learn python programming › how to install python › install python on linux
How to Install Python on Linux - A Step-by-Step Guide
May 3, 2024 - Open your terminal and type the command sudo apt-get install python to install the latest version of Python. This will download Python for linux and install it. Once the installation is complete, check your Python version using the command python ...
🌐
Reddit
reddit.com › r/learnpython › installing python on linux - help?
r/learnpython on Reddit: Installing python on Linux - help?
May 26, 2024 -

I am a long-time user of Python but I have never understood how to install python "properly" - I tend to figure out some way to get it done when I need to, and then forget all about it. But I want to understand it a bit better because it isn't straightforward in my opinion. I am not considering Pyenv or other such "helper" tools/dependencies - I want to learn how to do this the "official" way. I've looked at the official docs but can't see what I've done incorrectly. The main issue is that at some stage I often find myself wanting a newer version of python than what is provided, and then I end up a bit stuck.

I installed Debian and it came with python3 under my /usr/local/bin directory. There is also a Python installation under /usr/bin/python3.11, which I guess is my system python? I believe I was always interacting with my /usr/local/bin python - not the system python, so that's good. (Also I'm always using virtual environments, so let's not discuss their importance please). That was working fine for me, but now I want to upgrade my version of python and I am facing difficulties.

  • What should I do to upgrade python in an "official" way (i.e. not adding dev repositories like deadsnakes, not using helper tools like Pyenv)?

  • What do I need to do with pip? Currently, the pip command actually points to /usr/bin/python - i have to use pip3* (see below).

  • Can I simply delete the old python and pip versions from /usr/local/bin if I wanted to?

  • How do I ensure that every time I type python3 in the terminal, it grabs the latest one? Do I just ensure it is higher up in my PATH variable?

  • Why is there not one simple way to do this? Obviously everyone has slightly different needs, but I imagine 80% of python users just want to use python and have a reasonable way to upgrade when required without screwing something up in their system.

To explain why I'm asking this now, I installed the python source from the main website yesterday and tried to get it working but something is off. Here's what I did

  • Extracted the Python-3.12.3.tar.xz

  • Moved into the dir and ran ./configure --enable-optimizations --with-ensurepip=install

  • Ran make

  • Ran sudo make install

This worked, but I notice when I run python in the terminal REPL that I can't use the up/down keys to cycle through my command history:

>>> print("hello")
hello
>>> ^[[A

*Also, I notice that I now have pip (/usr/bin/python), pip3, and pip3.12 now, and I am confused about that. Should I alias pip with pip3.12 to prevent interacting with the system python? Should I just delete pip3 and make sure pip3 points to pip3.12?

These issues have convinced me that I've now installed python incorrectly somehow. I found some info about readline but that's deprecated, and I am starting to go down the rabbit hole of running random commands to try and fix things, which is probably going to make things worse.

Top answer
1 of 4
25

the reason I am asking is because I have both the Python 2 and 3 interpreter installed on my computer, and so it is ambiguous, as both are run using the command "python".

To run Python 2 executable:

C:\> py -2

To run Python 3 executable:

C:\> py -3

where py is a Python launcher that is bundled with your Python 3 installation.

py recognizes the shebang (e.g., #!/usr/bin/env python3 causes Python 3 executable to be run), it respects virtualenv (if you run py without specifying the explicit python executable version) i.e., run:

C:\> py your_script.py

and the correct python version is used automatically -- you don't need to specify the Python version on the command-line explicitly.

is there a particular reason why Python 3.x is not installed on Windows to run default with the command line "python3", like it does on Mac OSX and Linux?

OSX and Linux have python executable installed by default as a rule and it refers to Python 2 version in most cases at the moment that is why you need a separate python3 name there.

There is no Python on Windows by default. And therefore any version that you've installed is just python (I guess). The recommended way to manage multiple python versions is to use the Python launcher.

Is there some kind of way to configure Python so that it runs like this?

If you want to type python3 some_script.py instead of py some_script.py or even just some_script (assuming .py is in %PATHEXT% and Python launcher is configured to run Python scripts (check assoc .py and ftype Python.File) -- the default) then create a bat-file e.g., python3.cmd and put it in %PATH%:

"C:\path to\Python 3.X\python.exe" %*
2 of 4
2

You likely missed the checkbox at the bottom of the installer.

Full documentation here: https://docs.python.org/3/using/windows.html

Then, I think you just run python, not python3 from the Command Prompt. The reason Unix systems have python3 is because python defaults to Python2.x in many systems.