Python · January 10, 2024

Install Python on Windows, Linux, Mac

Ready to dive into the world of Python? Buckle up, because we’re about to take you on a smooth installation journey across Windows, Linux, and macOS. Whether you’re a seasoned coder or just starting out, this guide has you covered.

Windows:

  • Download the Installer:
  • Run the Installer:
    • Double-click the downloaded file.
    • Crucially, check “Add Python 3.x to PATH” or “Add python.exe to PATH” to easily run Python from the command line.
    • Click “Install Now” and follow the prompts.
    • At last if asked click on the option “Disable path length limit” and finish the installation.

Linux:

  • Check for Existing Python:
    • Open a terminal and type python3 --version.
    • If Python 3 is already installed, you’re good to go!
  • If Not Installed:
    • Use your package manager:
      • Ubuntu/Debian: sudo apt install python3
      • Fedora/CentOS: sudo dnf install python3
      • Arch Linux: sudo pacman -S python
    • For different Linux OS flavors the package manager will be different.

macOS:

  • Check for Existing Python:
    • Open a terminal and type python3 --version.
  • If Not Installed:
    1. Via standalone installer similar to python
    2. Via command line using brew package manager.
      • If brew package manage is installed then run the below commnad.
        • brew install python
      • If brew is not installed then first install the brew and then install python using below commands.
        • /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
        • brew install python

Verification (Across All Systems):

  • Open a terminal and type python3 --version. The installed version should be displayed.

Additional Considerations:

  • Multiple Python Versions: If you need to manage multiple Python versions, consider using tools like pyenv or virtual environments.
  • Package Managers: Explore pip for installing Python packages and libraries.
  • Editors and IDEs: Choose a suitable code editor or IDE for Python development (e.g., IDLE, Visual Studio Code, PyCharm).
  • Community and Resources: Tap into Python’s vast community and online resources for learning and troubleshooting.

Congratulations, you’re now equipped with Python across platforms! Embark on your coding adventures and create incredible projects. Remember, the learning journey is just as exciting as the destination.