Installing Python is a straightforward process, and there are different methods depending on your operating system. Here are the general steps for the most common operating systems: Windows, macOS, and Linux.
- Windows:
- Visit the official Python website at https://www.python.org/downloads/.
- Click on the “Downloads” tab, and you’ll see the latest version of Python listed.
- Choose the installer appropriate for your version of Windows (32-bit or 64-bit).
- Download the installer executable and run it.
- Make sure to check the box that says “Add Python X.Y to PATH” during installation. This will allow you to run Python from the command line easily.
- Follow the on-screen instructions to complete the installation.
2. macOS:
- macOS usually comes with a pre-installed version of Python, but you can install a newer version using package managers like Homebrew or by downloading directly from the Python website.
- If you’re using Homebrew, open your terminal and run:
brew install python. - Alternatively, you can download the macOS installer from the official Python website and run it.
- Follow the installation instructions provided.
3. Linux:
- Most Linux distributions come with Python pre-installed. You can check by opening a terminal and typing
python3 --versionorpython --version. - If it’s not installed or you want to install a specific version, use your package manager. For example, on Ubuntu, you can use:
sudo apt-get install python3. - Make sure to include the version number after
python(e.g.,python3) to ensure compatibility.
Verifying Installation:
Get Tharindu Dhananjaya’s stories in your inbox
Join Medium for free to get updates from this writer.
After installation, you can verify that Python is installed correctly by opening a terminal or command prompt and typing python3 (or python on Windows). You should see the Python interpreter prompt, where you can type Python code directly.
Remember that the version numbers might differ based on when you’re installing, so adapt the instructions accordingly.
Keep in mind that Python 2 has reached its end of life and is no longer officially supported. It’s recommended to use Python 3 for all new projects.
Once Python is installed, you can start writing and executing Python scripts to explore the language’s capabilities.









