Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
https://pctechmag.co.uk/ PC Tech Mag

Tech news, gadget reviews, tips, and digital trends — PC Tech Mag keeps you informed on everything technology.

https://pctechmag.co.uk/ PC Tech Mag

Tech news, gadget reviews, tips, and digital trends — PC Tech Mag keeps you informed on everything technology.

  • Home
  • About us
  • Contact us
  • Tech

About This Site

PC Tech Mag is an online tech magazine with PC hardware and gaming guides, Windows tips, software explainers and gadget coverage.

Recent Posts

  • How to Find Duplicates in Google Sheets: 5 Easy Methods
  • How to Add Speaker Notes in PowerPoint: A Step-by-Step Guide
  • Lighter Linux: The Best Lightweight Linux Distros for Old and Slow PCs
  • Ubuntu vs Mint: Which Linux Distro Should You Choose in 2026?
  • How Do I Send a GIF in a Text Message? A Complete Guide for iPhone and Android

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Find Us

Contact: farmanali5starseo@gmail.com

  • Home
  • About us
  • Contact us
  • Tech
Subscribe
Close

Search

Python code open in a modern code editor on a monitor — best python ides
Software & Apps

How to Check Python Version on Windows, Mac and Linux

By admin
November 9, 2026 8 Min Read
3

Before you install a package, follow a tutorial, or fix a bug, you need to know which version of Python is actually running on your computer. Different versions behave differently: a feature that works in Python 3.12 may not exist in Python 3.8, and a library that needs Python 3.10 or later will simply refuse to install on an older release. Checking takes about ten seconds, and it saves hours of confusing errors later.

This guide shows how to check Python version on Windows, Mac, and Linux, how to check it from inside a Python script, how to see the versions used by different tools, and what to do when the command does not work at all. No extra software is needed: every method below uses tools that are already on your system.

Quick Answer: How to Check Python Version

Open a terminal or Command Prompt and type python --version or python3 --version, then press Enter. The computer prints a line such as Python 3.12.4. That is your version. On Windows, use python --version first. On Mac and Linux, use python3 --version first, because python alone often points to the old Python 2 or to nothing at all.

SystemCommand to try firstCommand to try second
Windowspython –versionpy –version
Macpython3 –versionpython –version
Linuxpython3 –versionpython –version
Inside Pythonimport sys; print(sys.version)python -c “import sys; print(sys.version)”

How to Check Python Version on Windows

Windows is the system where people most often run into two Pythons at once: one from the Microsoft Store, one from python.org, or one bundled with another program. These steps find the one your terminal actually uses.

  1. Press Win + R, type cmd, and press Enter to open Command Prompt. You can also open PowerShell or Windows Terminal.
  2. Type python --version and press Enter. You should see something like Python 3.12.4.
  3. If that says Python was not found, try py --version. The py launcher is installed with Python from python.org and can find the newest version for you.
  4. To see exactly where Python lives, type where python or where py. The path tells you whether you are using the Microsoft Store version, a python.org install, or an Anaconda install.
  5. To list every version the launcher knows about, type py -0p. You can then run a specific one, for example py -3.11 --version.

If Command Prompt says ‘Python’ is not recognised as an internal or external command, Python is installed but not on your PATH, or it is not installed at all. Reinstall Python from python.org and tick Add python.exe to PATH during setup, or use the Microsoft Store version, which sets itself up automatically. Close and reopen the terminal after installing, because a terminal that was already open will not see the change.

Python code open in a modern code editor on a monitor — best python ides
Once you know your Python version, a good code editor makes it much easier to work with.

How to Check Python Version on Mac

Every modern Mac ships with a Python, but it is not the one you should use for your own projects. Apple includes a system Python for its own tools, and it is usually an older version. You need to check the version you installed yourself.

  1. Open Terminal from Applications, then Utilities, or press Cmd + Space and type Terminal.
  2. Type python3 --version and press Enter. A typical answer is Python 3.12.4 or Python 3.13.0.
  3. Type which python3 to see the path. If it says /usr/bin/python3, that is Apple’s system Python. If it says /opt/homebrew/bin/python3, that is the Homebrew version, and if it says /usr/local/bin/python3, it came from python.org or another installer.
  4. If you use Homebrew, type brew list python@3.12 or brew info python to see which versions Homebrew has installed.

Do not delete or replace Apple’s system Python. macOS tools depend on it, and removing it can break the system. Instead, install your own Python with Homebrew (brew install python) or from python.org, and always call it with python3. If python without the 3 gives you Python 2.7, that is normal on older Macs and is not a problem, as long as python3 works.

How to Check Python Version on Linux

Linux distributions also ship a system Python, and the exact commands vary a little between Ubuntu, Debian, Fedora, and Arch, but the basic check is the same everywhere.

  1. Open a terminal with Ctrl + Alt + T or from your applications menu.
  2. Type python3 --version and press Enter.
  3. Type which python3 and ls /usr/bin/python* to see every Python binary on the system.
  4. On Ubuntu or Debian, type apt list --installed | grep python3 to see the installed Python packages and their versions.
  5. On Fedora, type dnf list installed python3, and on Arch, type pacman -Q python.

On Linux, never remove the system Python or change the default python3 link by hand, because the package manager and desktop tools depend on it. If you need a newer version than your distribution provides, install it alongside the system one with a tool such as pyenv, deadsnakes on Ubuntu, or a package from python.org, and call it by its full version name, for example python3.12. Our guide to how to check your Ubuntu version is useful here, because the Python version available in Ubuntu’s repositories depends on which Ubuntu release you are running.

How to Check Python Version Inside a Script or Notebook

Sometimes the terminal and your project use different Pythons. A virtual environment, a notebook, or an editor can all point somewhere else. Checking from inside Python itself tells you the truth for that project.

  1. Start Python by typing python3 in a terminal, or open a Python file in your editor.
  2. Run import sys and then print(sys.version). The output includes the version number, the build date, and the compiler.
  3. For just the number, run print(sys.version_info) or import platform; print(platform.python_version()).
  4. From the command line without opening Python, run python3 -c "import sys; print(sys.version)".
  5. In Jupyter, run a cell containing import sys; print(sys.version) to see the version that notebook kernel is using.

If the version inside your editor is different from the version in your terminal, your editor is using a different interpreter. In VS Code, click the Python version in the bottom right corner and choose the interpreter you want. In PyCharm, go to Settings, then Project, then Python Interpreter, and pick the right one. Once you know which Python each tool uses, set up a good editor: our roundup of the best Python IDEs compares the main options, from VS Code and PyCharm to lighter editors.

Python 2 vs Python 3: Why the Command Matters

Python 2 reached the end of its life in 2020, and Python 3 is the only version that receives updates. Even so, many computers still have a python command that points to Python 2, especially older Macs and Linux systems. That is why the version check matters: running python --version and seeing Python 2.7.18 does not mean you have no Python 3, only that python is the old name.

CommandUsually meansWhat to use instead
pythonPython 2 on older systems; Python 3 on newer Windows installspython3 on Mac and Linux
python3Python 3Use this everywhere for new work
pyPython launcher on Windowspy -3.12 to pick a version
python3.12Exactly Python 3.12Use when several versions are installed

If a tutorial tells you to run python and it fails or gives the wrong version, try python3 with the same arguments. The code is the same; only the command name changes. On Windows, you can also use py -3 to force the launcher to use Python 3.

How to Check the Version of a Package and of pip

Knowing the Python version is only half the story. A library may need a newer Python, or pip itself may be out of date. Check both before you install anything.

  1. Check pip with pip --version or python3 -m pip --version. The output shows the pip version and the Python version it belongs to, which is a useful cross-check.
  2. Check a package with pip show numpy, replacing numpy with the package name. The output shows its version and where it is installed.
  3. List all packages with pip list or python3 -m pip list.
  4. Check a package from inside Python with import numpy; print(numpy.__version__).

Always use python3 -m pip rather than plain pip when you have more than one Python installed, because pip on its own may belong to a different Python than the one you are using. If pip is missing, install it with python3 -m ensurepip on most systems, or your package manager on Linux.

Troubleshooting: When the Version Check Fails

ProblemLikely causeFix
‘python’ is not recognisedPython not on PATH, or not installedReinstall with Add to PATH ticked, or use py on Windows
python gives 2.7, python3 gives 3.xOld python command still points to Python 2Use python3; do not delete the system Python
Terminal and editor show different versionsEditor uses a different interpreter or virtual environmentChange the interpreter in the editor settings
Version is older than a tutorial needsSystem Python is oldInstall a newer Python alongside it; do not replace the system one
pip installs to the wrong Pythonpip belongs to another PythonUse python3 -m pip instead of pip

If you work on Linux, the same terminal skills help in other jobs too: our guide to how to rename a directory in Linux covers the basic commands you will use alongside Python every day.

Frequently Asked Questions

What is the command to check Python version?

Type python --version on Windows or python3 --version on Mac and Linux, then press Enter. The computer prints the version, for example Python 3.12.4.

How do I check Python version in VS Code?

Look at the Python version shown in the bottom right corner of VS Code, or open the terminal inside VS Code and run python --version. Click the version in the corner to change interpreters.

How do I know if I have Python 2 or Python 3?

Run python --version and python3 --version. If the first says 2.7 and the second says 3.x, you have both. Use Python 3 for all new work.

How do I update Python to the latest version?

Download the latest installer from python.org, or use Homebrew on Mac (brew upgrade python) or your package manager on Linux. Installing a new version does not remove the old one, so check the version again after installing.

Why does python –version not work on my Mac?

On many Macs, python is not set up, or it points to the old Python 2. Use python3 --version instead, which is the command for the Python 3 you installed.

Conclusion

Checking your Python version is a ten-second habit that prevents most version problems before they start. On Windows, run python --version; on Mac and Linux, run python3 --version; and inside a script, use sys.version to see exactly which Python that project is using. If the number is older than the tutorial or library needs, install a newer Python alongside the system one rather than replacing it. Write the version down when you start a project, and check it again whenever something that used to work suddenly stops.

Author

admin

Follow Me
Other Articles
Friends chatting online with headsets while using blogging and community platforms, illustrating LiveJournal alternatives for journaling and online blogging
Previous

How to Turn Off Discord Overlay: In-Game, Per-Game and Completely

Smartphone showing a five-star Google review being written — write a Google review
Next

What Is Google Lens? How It Works and the Best Ways to Use It

3 Comments
  1. ls -la: What the Linux ls -la Command Does, With Examples - PC Tech Mag says:
    November 23, 2026 at 7:29 am

    […] directory is not executable, you cannot reach it. If you are learning Python on Linux, our guide on how to check the Python version will help you confirm which Python your scripts will use, and our guide on how to format an SSD […]

    Reply
  2. How to Connect an Autoresponder for WhatsApp With ChatGPT API: A Step-by-Step Guide - PC Tech Mag says:
    November 23, 2026 at 7:34 am

    […] you are new to Python, start by confirming your setup with our guide on how to check the Python version on your computer, so you know which Python your bot will run […]

    Reply
  3. How to Append in Python: append() Explained With Examples - PC Tech Mag says:
    November 26, 2026 at 4:09 am

    […] are still setting up Python, first check which version you have installed by following our guide on how to check the Python version on Windows, Mac and Linux, because the behaviour described here works the same in Python 3, which is the version you should […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About This Site

PC Tech Mag is an online tech magazine with PC hardware and gaming guides, Windows tips, software explainers and gadget coverage.

Search

Recent Posts

  • How to Find Duplicates in Google Sheets: 5 Easy Methods
  • How to Add Speaker Notes in PowerPoint: A Step-by-Step Guide
  • Lighter Linux: The Best Lightweight Linux Distros for Old and Slow PCs
  • Ubuntu vs Mint: Which Linux Distro Should You Choose in 2026?
  • How Do I Send a GIF in a Text Message? A Complete Guide for iPhone and Android

Find Us

Contact: farmanali5starseo@gmail.com

About This Site

PC Tech Mag is an online tech magazine with PC hardware and gaming guides, Windows tips, software explainers and gadget coverage.

Recent Posts

  • How to Find Duplicates in Google Sheets: 5 Easy Methods
  • How to Add Speaker Notes in PowerPoint: A Step-by-Step Guide
  • Lighter Linux: The Best Lightweight Linux Distros for Old and Slow PCs
  • Ubuntu vs Mint: Which Linux Distro Should You Choose in 2026?
  • How Do I Send a GIF in a Text Message? A Complete Guide for iPhone and Android

Archives

  • December 2026 (15)
  • November 2026 (192)
  • October 2026 (85)

Find Us

Contact: farmanali5starseo@gmail.com

Copyright 2026 — PC Tech Mag. All rights reserved. Blogsy WordPress Theme