So, you want to know which version of Python is on your computer? Great choice. Python is cool, fun, and powerful. Whether you’re using Windows, macOS, or Linux, checking your Python version is super easy. We’ll walk through it step-by-step. Grab a snack. Let’s make this fun!
Why Should You Check the Python Version?
Before we dive into the how, let’s understand the why.
- Compatibility: Some programs only work with certain versions of Python.
- Features: Newer versions come with cool new features and improvements.
- Troubleshooting: Helps in debugging or asking for help online.
Now, let’s roll up our sleeves and check it out on each system.
1. Checking Python Version on Windows
Method 1: Using Command Prompt
- Click the Start menu.
- Type cmd and hit Enter.
- In the black window that pops up, type:
python --versionorpython -V - Press Enter.
You should see something like: Python 3.10.4
Method 2: Using Windows PowerShell
- Right-click on the Start menu button.
- Select Windows Terminal or PowerShell.
- Type the same command:
python --version
Simple, right?
If It Doesn’t Work
If you see a message like “Python is not recognized as an internal or external command”, Python might not be installed or added to your system path.
Don’t worry. You can go to python.org and download the latest version. Install it, and make sure to check the box that says Add Python to PATH before clicking Next.
2. Checking Python Version on Mac
Method: Use the Terminal
- Press Command + Space to open Spotlight.
- Type Terminal and hit Enter.
- In Terminal, type:
python --version - Hit Enter.
You might also try:python3 --version
Why the extra 3? macOS usually comes with Python 2.x by default. But most new code uses Python 3.
So, to be safe, check both python and python3.
You’ll see something like:
Python 2.7.18 Python 3.11.1
Pro Tip
Install Homebrew and use it to manage your Python versions easily:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install python
3. Checking Python Version on Linux
Method: Use the Terminal
- Open a Terminal window. (Ctrl + Alt + T usually works)
- Type:
python --version - Or try:
python3 --version
Like macOS, many Linux systems have both Python 2 and 3. It’s good to check both.
Sample output:
Python 3.9.6
If that didn’t work, you can try:
which python which python3
That tells you where Python is installed.
If You Don’t Have Python
Some minimal Linux distributions might not have Python installed. But don’t panic. You can install it using your package manager:
For Debian/Ubuntu:
sudo apt update sudo apt install python3
For Fedora:
sudo dnf install python3
For Arch Linux:
sudo pacman -S python
Bonus Tip: Using Python In Your Code
Want to check the version from your Python script? Just add this line:
import sys print(sys.version)
Run the script and boom! You see detailed version info, including the date it was built.
How to Switch Between Python Versions
Sometimes you’ll need more than one version. You can use tools that help you manage them.
- Windows: Use Python Launcher for Windows. Run with
py -3.8orpy -3.10 - Mac & Linux: Use pyenv. It’s like magic for version switching!
Install pyenv on macOS or Linux with:
curl https://pyenv.run | bash
Then add these lines to your .bashrc or .zshrc:
export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)"
In Summary
Knowing your Python version is important. Whether you’re working on fun little scripts, school projects, or full-blown apps, you need the right tools.
Here’s a quick recap:
- Open Terminal or Command Prompt.
- Type
python --versionorpython3 --version. - No Python? Download it from python.org.
- Use version managers to switch between versions.
Easy-peasy, lemon squeezy.
Now that you’re a Python version detective—go make something awesome!



