Python installation takes five to ten minutes and works the same way on Windows, Mac, and Linux
Download Python from python.org, run the installer, and follow the on-screen prompts. On Windows, check the box that says "Add Python to PATH" before clicking Install — this step lets you run Python from the command line without typing the full file path. On Mac and Linux, Python often comes pre-installed, but you can download a newer version if you need it. After installation finishes, open your terminal or command prompt and type python --version to confirm it worked.
The process differs slightly between operating systems, but the goal is the same: get Python on your computer so you can write and run Python code. Most people use Python 3, the current version. Python 2 is older and no longer supported, so avoid it unless a specific project requires it.
Key Takeaways
- Download Python 3 from python.org, not from other sources, to avoid malware or outdated versions.
- On Windows, check "Add Python to PATH" during installation so you can run Python from any folder in the command prompt.
- Mac and Linux users should verify their Python version after installation by typing python3 --version in the terminal.
- After installation, you can test Python by opening a terminal and typing python or python3 to enter the interactive shell.
Installing Python on Windows
Go to python.org and click the large yellow "Download Python" button. This downloads the latest stable version for Windows. Run the installer file (it will have a .exe extension). A window appears asking where to install Python — the default location works fine for most people.
Before you click Install, look for a checkbox labeled "Add Python to PATH" near the bottom of the installer window. Check this box. This step is important: it tells Windows where to find Python when you type commands in the command prompt. Without it, you will have to type the full file path every time you want to run Python.
Click Install and wait for the process to finish. When it completes, open the command prompt (search for "cmd" in the Windows search bar) and type python --version. If you see a version number like "Python 3.12.0", the installation worked.
Installing Python on Mac
Mac comes with Python 2 pre-installed, but Python 2 is no longer supported. You should install Python 3 instead. Go to python.org and download the Mac installer. The site detects your Mac's processor (Intel or Apple Silicon) and offers the correct version automatically.
Run the installer and follow the prompts. It will ask for your Mac password to complete the installation. When it finishes, open the Terminal app (search for "Terminal" in Spotlight) and type python3 --version. Note that you use python3, not python, because the old Python 2 is still on your system. Using python3 ensures you run the new version.
If you prefer to type python instead of python3, you can create an alias in your terminal configuration file, but this is optional and not necessary to use Python.
Installing Python on Linux
Most Linux distributions come with Python 3 already installed. Open a terminal and type python3 --version to check. If you see a version number, Python is ready to use and you do not need to install anything.
If Python is not installed or you want a newer version, use your distribution's package manager. On Ubuntu or Debian, type sudo apt update followed by sudo apt install python3. On Fedora, type sudo dnf install python3. On Arch, type sudo pacman -S python. After installation finishes, type python3 --version to confirm.
Verifying your installation with a test script
After installing Python, you can test it by writing a simple program. Open a text editor (Notepad on Windows, TextEdit on Mac, or any editor on Linux) and type the following:
print("Hello, Python")
Save the file with a .py extension — for example, test.py. Open your terminal or command prompt, navigate to the folder where you saved the file, and type python test.py (or python3 test.py on Mac and Linux). If you see "Hello, Python" printed on the screen, Python is working correctly.
Choosing between Python versions and distributions
Python.org offers the official version, which works on all three operating systems. This is the version most people should download. Some Linux distributions offer Python through their package managers, which is also fine — it is the same Python, just installed through your system's software tool.
You may see other Python distributions like Anaconda or Miniconda, which include extra tools for data science and scientific computing. These are useful if you plan to work with data analysis or machine learning, but they are not necessary for learning Python or general programming. Start with the official Python from python.org unless you have a specific reason to use something else.
Troubleshooting common installation problems
If you type python --version and see "command not found" or "is not recognized", Python is not in your PATH. On Windows, reinstall Python and make sure you check "Add Python to PATH". On Mac and Linux, use python3 instead of python, or check that your terminal is looking in the correct folder.
If the installer fails or freezes, close it completely and try again. Make sure you have enough disk space (Python needs less than 200 MB) and that your user account has permission to install software. On Mac, you may need to allow the installer in System Preferences under Security & Privacy.
If you installed Python but cannot find it, check the installation location. On Windows, it is usually in C:\Users\YourUsername\AppData\Local\Programs\Python. On Mac, it is usually in /Library/Frameworks/Python.framework. On Linux, it is usually in /usr/bin or /usr/local/bin.
Frequently Asked Questions
Do I need to uninstall Python 2 before installing Python 3?
No. Python 2 and Python 3 can coexist on the same computer. On Mac and Linux, Python 2 stays as python and Python 3 becomes python3. On Windows, the newer installer replaces the old version automatically. You do not need to remove anything.
What is the difference between python.org and other download sites?
Python.org is the official source maintained by the Python Software Foundation. Other sites may offer older versions, modified versions, or bundled software you do not need. Always download from python.org to ensure you get the correct, current version.
Can I run Python without installing it?
Yes, you can use online Python editors like replit.com or python.org's built-in shell to write and run Python code in your web browser. This is useful for learning or testing small programs, but for serious work or local projects, installing Python on your computer is faster and more reliable.
Why does Mac ask for my password during installation?
Mac requires a password to install software in system folders. This is a security feature. Type your Mac login password when prompted — the installer needs it to complete the setup.
What should I do after Python is installed?
You can start writing Python code immediately. Open a text editor, write a Python script, save it with a .py extension, and run it from the terminal. Many people also install a code editor like Visual Studio Code or PyCharm to make writing Python easier, but this is optional.