Як встановити Python на Windows, macOS і Linux правильно

How to Install Python on Windows, macOS, and Linux

How to install Python is usually the first question before running scripts, learning to code, or setting up automation. The process is slightly different on each operating system, but the logic is the same: choose a current version, install the interpreter, and confirm that the system recognizes the python or python3 command.

Which Python version to choose

The best choice for most users is the latest stable Python 3 release unless a specific project requires something else.

That option is usually the safest because it works well with modern libraries and packages. If you are following older tutorials, maintaining legacy code, or working in a company environment, check the required version first. For new projects, Python 3 is almost always the right answer.

How to install Python on Windows

On Windows, the easiest way to install Python is with the official installer, which adds the interpreter and supporting components in a few clicks.

  • Download the Windows installer from the official Python website.
  • Run the file and make sure Add Python to PATH is selected.
  • Choose Install Now, or use custom settings if you need a different install location.
  • When the installation finishes, open PowerShell or Command Prompt and run python –version.

If the command does not work, restart the terminal first and then try again. If Windows opens Microsoft Store instead of Python, reinstall with PATH enabled or disable the app execution alias for Python in system settings. A successful check should return the installed version number in the terminal.

How to install Python on macOS

On macOS, Python can be installed with the official package or through a package manager if you want more flexible version control.

The simplest option is to download the macOS installer, run it, and complete the standard setup. After that, open Terminal and check python3 –version, because macOS usually uses that command for Python 3.

If you need multiple versions or expect frequent updates, Homebrew is often the more practical choice. It keeps Python separate from system components and makes updates more predictable. After installation, verify that python3 –version returns the expected release.

How to install Python on Linux

On Linux, Python is often already installed, but development work usually needs a current version and the package manager for libraries.

Debian, Ubuntu, and their derivatives typically use apt, while Fedora, RHEL, and CentOS usually rely on dnf or yum. After installation, check both the interpreter version and pip, so you know packages can be installed correctly.

  • Update the system package list.
  • Install Python 3 and, if needed, the package that provides pip.
  • Check python3 –version.
  • Run pip3 –version to confirm the package manager is available.

If either command fails, the next step is to confirm that the package was installed for the current distribution and that the terminal session is using the expected Python path. A working setup should show version information for both Python and pip.

How to check that everything works

The most reliable way to verify a Python installation is to run a short terminal command and get a clean response from the system.

Enter python –version or python3 –version, then open the interactive interpreter with python or python3. If the prompt appears, type print(“Hello”) and confirm that the text prints without errors.

If the command is not found, the usual causes are PATH issues, the wrong command name, or an incomplete installation. In that case, check the installer path and environment settings before reinstalling from scratch.

What to set up right after installation

After the basic installation, it is worth preparing the environment for projects right away so system packages do not get mixed with libraries for a specific task.

  • Create a virtual environment for each separate project.
  • Update pip to avoid package installation issues.
  • Check that python and pip work in the terminal you plan to use.
  • Save the install path if the computer will have more than one Python version.

This approach makes library management easier, reduces conflicts, and keeps future project setup much more predictable.