How to Check if Python Is Installed on Your Computer
Mar 02, 2026 5 Min Read 189 Views
(Last Updated)
Have you ever tried running a Python script only to see an error saying “Python is not recognized”? Before installing anything, the first step is to check whether Python is already installed on your system.
In this guide, you’ll learn how to check if Python is installed on Windows, macOS, and Linux, how to verify the version, and what to do if Python is not detected.
TL/DR Summary:
To quickly confirm Python installation, open Command Prompt (Windows) or Terminal (Linux/macOS) and run python –version or python3 –version. Then verify its location using where python (Windows) or which python3(Linux/macOS), and ensure package management works by checking pip –version or pip3 –version.
Table of contents
- How to Check if Python Is Installed?
- On Windows
- On macOS
- Check Python Installation Path on macOS
- On Linux
- Common Errors When Checking Python Installation
- Best Practices While Checking Python Installation
- Always Verify Both python and python3
- Confirm the Installation Path
- Check Detailed Version Information
- Verify pip Alongside Python
- Restart Terminal After Installation
- Conclusion
- FAQs
- How do I know if Python is installed correctly on my system?
- Why does my system say “Python is not recognized” even after installation?
- How can I check if pip is linked to the correct Python version?
How to Check if Python Is Installed?
1. On Windows
Before installing Python, it is important to verify whether it is already available on your Windows system. Windows does not always come with Python preinstalled, but many users may already have it installed through development tools, Microsoft Store, or previous setups. The steps below help you confirm installation, check the version, and verify the installation path.
Step 1: Open Command Prompt
To check Python from the system level, you need to use Command Prompt.
- Press Win + R on your keyboard to open the Run dialog box.
- Type cmd.
- Press Enter.
This opens the Command Prompt window where you can run system commands.
Alternatively, you can:
- Click the Start menu
- Search for “Command Prompt”
- Click to open it
Step 2: Run the Python Version Command
In the Command Prompt window, type the following command and press Enter:
python --version
You can also use the short form:
python -V
Both commands perform the same function, they check whether Python is installed and display the installed version.
Step 3: Check Expected Output
If Python Is Installed
You will see output similar to:
Python 3.x.x
For example:
Python 3.11.6
This confirms:
- Python is installed
- It is correctly added to the system PATH
- The displayed version is the active default Python interpreter
If Python Is Not Installed (or Not Added to PATH)
You may see an error such as:
‘python’ is not recognized as an internal or external command,
operable program or batch file.
This means one of the following:
- Python is not installed on your system
- Python is installed but not added to the system PATH environment variable
In this case, you may need to install Python or update your environment variables.
Want to reinforce your Python setup knowledge with clear, structured notes and handy examples? Download HCL GUVI’s Python eBook to master key concepts like installation checks, fundamentals, and practical coding tips in one place.
2. On macOS
Unlike Windows, macOS may include a system-level Python installation, but modern development typically relies on Python 3. It is important to verify whether Python 3 is installed and accessible through the Terminal.
Step 1: Open Terminal
You can open Terminal in the following ways:
- Press Command + Space to open Spotlight Search.
- Type Terminal.
- Press Enter.
Alternatively:
- Go to Applications → Utilities → Terminal
Step 2: Run the Python Version Command
In the Terminal window, type:
python3 –version
Press Enter.
Step 3: Check Expected Output
If Python Is Installed
You will see output similar to:
Python 3.x.x
For example:
Python 3.10.12
This confirms:
- Python 3 is installed
- The system recognizes the interpreter
- It is correctly configured in your PATH
If Python Is Not Installed
You may see a message such as:
command not found: python3
On newer macOS versions, you might see a prompt asking to install developer tools. This means Python is not currently installed or not accessible from the command line.
Why Use python3 Instead of python on macOS?
On macOS:
- python may refer to an older system-managed version (or may not exist at all).
- python3 is the standard command for modern Python installations.
Using python3 ensures you are working with Python 3, which is actively supported.
Check Python Installation Path on macOS
To see where Python is installed, run:
which python3
If installed correctly, you will see a path similar to:
/usr/local/bin/python3
or
/opt/homebrew/bin/python3
This confirms:
- The installation directory
- Which Python binary is being executed
- Whether it was installed via system tools or a package manager
- Check Detailed Python Version Information
You can also start the Python interpreter:
python3
If installed, you will enter the interactive Python shell. You should see something like:
Python 3.x.x (default, ...)
>>>
To exit the shell, type:
exit()
- Verify pip Installation on macOS
To confirm that the Python package manager is installed:
pip3 --version
If pip is installed, it will display the version number and installation path.
If not installed, you may need to reinstall Python or install pip separately.
- Final Verification on macOS
After confirming the version and installation path:
- Python is installed if python3 –version returns a version number.
- It is properly configured if which python3 returns a valid directory.
- Your environment is ready if pip3 –version works successfully.
3. On Linux
Most modern Linux distributions come with Python preinstalled because many system utilities depend on it. However, the default version and command name may vary depending on the distribution. The steps below help you verify whether Python is installed and determine which version is active.
Step 1: Open the Terminal
On most Linux distributions, you can open the Terminal using:
- Ctrl + Alt + T
or - Search for Terminal in the applications menu
The Terminal allows you to run system-level commands to check installed software.
Step 2: Check the Python 3 Version
In the Terminal, type:
python3 --version
Press Enter.
Step 3: Check Expected Output
If Python Is Installed
You will see output similar to:
Python 3.x.x
For example:
Python 3.10.12
This confirms:
- Python 3 is installed
- The interpreter is accessible via your system PATH
- The displayed version is the active default Python 3 installation
If Python Is Not Installed
You may see an error such as:
command not found: python3
This means Python 3 is either:
- Not installed
- Not properly configured in the PATH
Still getting started with Python setup and basics? Explore HCL GUVI’s Python Hub for beginner-friendly guides, practical examples, and step-by-step explanations to strengthen core Python fundamentals.
Common Errors When Checking Python Installation
- “Python is not recognized as an internal or external command”
This error appears mainly on Windows when the system cannot locate the Python executable. It usually means Python is not installed or the installation directory is not added to the PATH environment variable. Reinstalling Python with the “Add Python to PATH” option enabled typically resolves this issue.
- “command not found: python” or “command not found: python3”
This error is common on macOS and Linux systems. It indicates that Python is either not installed or the command being used does not match the installed version. Many modern systems require python3 instead of python. Running python3 –version often resolves the confusion.
- pip is not recognized
If running pip –version returns an error, pip may not be installed or not configured in PATH. In some cases, Python is installed correctly but pip was skipped during installation. Using python -m pip –version can confirm whether pip exists but is not globally accessible.
- Multiple Python Versions Conflict
Some systems have multiple Python versions installed, which can cause version mismatches. For example, python may point to one version while pip installs packages for another. Running where python (Windows) or which python3(macOS/Linux) helps identify which interpreter is active.
- Python Opens Microsoft Store Instead of Running
On newer Windows versions, typing python may redirect to the Microsoft Store if Python is not properly installed. This means no executable is mapped in PATH. Installing Python from the official installer and enabling PATH integration fixes this behavior.
- Incorrect Python Architecture (32-bit vs 64-bit)
Sometimes Python is installed, but the wrong architecture version is active. This can create compatibility issues with certain libraries. Checking detailed version information using import sys; print(sys.version) helps confirm whether the build is 32-bit or 64-bit.
- Permission Denied Errors
On Linux or macOS, permission-related errors may occur when accessing Python or installing packages. To practice Python effectively without running into these issues, it’s recommended to use virtual environments or proper package management practices. Creating a virtual environment with python3 -m venv env and activating it before installing packages ensures you work in an isolated setup. This not only prevents permission errors but also keeps dependencies organized for each project.
Want to move from simply checking your Python setup to writing real Python code with confidence? Enroll in HCL GUVI’s Python Programming Course and learn with 100% online, self-paced modules, get full lifetime access, clear doubts through a dedicated forum, and practise coding on 4 gamified platforms designed to build real-world skills.
Best Practices While Checking Python Installation
1. Always Verify Both python and python3
Different operating systems use different command mappings. Windows commonly uses python, while macOS and Linux often use python3. Checking both ensures you identify the correct active interpreter and avoid version confusion.
2. Confirm the Installation Path
After verifying the version, check where Python environment is installed using where python (Windows) or which python3(macOS/Linux). This helps confirm which executable is being used, especially if multiple versions are installed.
3. Check Detailed Version Information
Do not rely only on python –version. Use the Python shell and run import sys; print(sys.version) to confirm full build details, architecture (32-bit or 64-bit), and compiler information. This is particularly important for development and production consistency.
4. Verify pip Alongside Python
Python alone is not enough for development. Always check pip –version or python -m pip –version to ensure the package manager is installed and linked to the correct Python interpreter.
5. Restart Terminal After Installation
After installing or modifying environment variables, always close and reopen Command Prompt or Terminal. Environment variable changes do not apply to already open sessions.
Conclusion
Checking whether Python is installed on Windows, macOS, or Linux is a simple but essential first step before starting any development work. By verifying the Python version, confirming the installation path, and ensuring pip is properly configured, you eliminate common setup issues that can disrupt your workflow. Whether you are troubleshooting a PATH error, managing multiple Python versions, or preparing your environment for package installation, these steps give you full visibility into your system configuration. Once Python and pip are correctly detected, your computer is fully ready for scripting, automation, software development, and modern programming tasks.
FAQs
1. How do I know if Python is installed correctly on my system?
Open Command Prompt (Windows) or Terminal (macOS/Linux) and run python –version or python3 –version. If a version number appears, Python is installed. To confirm proper configuration, also run where python (Windows) or which python3 (macOS/Linux) to verify the installation path.
2. Why does my system say “Python is not recognized” even after installation?
This usually means Python is not added to the PATH environment variable. Reinstall Python and make sure to select “Add Python to PATH” during installation, or manually update the PATH settings. After changes, restart the terminal and test again.
3. How can I check if pip is linked to the correct Python version?
Run pip –version or python -m pip –version. The output shows both the pip version and the Python version it is associated with. This ensures your package manager is correctly connected to the active Python interpreter.



Did you enjoy this article?