Skip to main content

Setting Up Your Development Environment (Part 1): Installing Python and pip

Following our exploration of The Python Ecosystem: Standard Library and PyPI, this article will guide you through the first step of setting up your development environment: installing Python and the package manager, pip.


📚 Prerequisites

A computer with an internet connection.


🎯 Article Outline: What You'll Master

In this article, you will learn:

  • How to install Python on Windows.
  • How to install Python on macOS.
  • How to install Python on Linux.
  • How to verify your Python and pip installation.

🧠 Section 1: Installing Python on Windows

There are two main ways to install Python on Windows:

  • From the Microsoft Store: This is the easiest method for beginners. Simply search for "Python" in the Microsoft Store and install the latest version. This method also takes care of adding Python to your system's PATH.

  • From the official Python website:

    1. Go to python.org/downloads/.
    2. Download the latest version of Python for Windows.
    3. Run the installer. Important: Check the box that says "Add Python to PATH" or "Add python.exe to PATH".
    4. Click "Install Now".

💻 Section 2: Installing Python on macOS

  • Using the Official Python Installer:

    1. Go to python.org/downloads/.
    2. Download the latest version of Python for macOS.
    3. Run the installer.
    4. After the installation, open the /Applications/Python 3.x folder and double-click on Install Certificates.command and Update Shell Profile.command.
  • Using Homebrew: If you have Homebrew installed, you can simply run the following command in your terminal:

    brew install python3

🛠️ Section 3: Installing Python on Linux

Most Linux distributions come with Python pre-installed. You can check by running python3 --version in your terminal. If you need to install it, you can use your distribution's package manager.

  • For Debian-based distributions (Ubuntu, Mint):

    sudo apt update
    sudo apt install python3
  • For Fedora, Red Hat, CentOS:

    sudo dnf install python3
  • For Arch Linux:

    sudo pacman -S python

🔬 Section 4: Verifying Your Installation

Once you've installed Python, you can verify the installation by opening your terminal or command prompt and running the following commands:

  • To check your Python version:

    python3 --version

    (On Windows, you might need to use python --version)

  • To check your pip version:

    pip3 --version

    (On Windows, you might need to use pip --version)


💡 Conclusion & Key Takeaways

You've now successfully installed Python and pip on your computer. You're ready to start writing code and exploring the vast Python ecosystem.

Let's summarize the key takeaways:

  • Windows: Install from the Microsoft Store or the official website (remember to add to PATH).
  • macOS: Install from the official website or use Homebrew.
  • Linux: Python is usually pre-installed, but you can use your package manager to install it.
  • Verification: Use python3 --version and pip3 --version to verify your installation.

➡️ Next Steps

In the next article, we'll continue setting up our development environment by exploring "Setting Up Your Development Environment (Part 2): Configuring your IDE/editor (VS Code, PyCharm) and virtual environments."

Happy coding!


Glossary (Python Terms)

  • IDE (Integrated Development Environment): A software application that provides comprehensive facilities to computer programmers for software development.
  • PATH: An environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located.

Further Reading (Python Resources)