Sign In
Sign In

How to Install Python on Windows 10

How to Install Python on Windows 10
Hostman Team
Technical writer
Python Windows
18.10.2024
Reading time: 5 min

Python is a high-level programming language used by millions of programmers and developers. It is intuitive, offers many useful tools and libraries, and is essential for working with and analyzing large datasets. However, Python is not pre-installed on Windows operating systems. This guide will walk you through installing Python on Windows 10.

Which Version to Choose

There are two main versions of Python: Python 2 and Python 3, and they are patible.

  • Python 3 was released in 2008 to address issues found in Python 2. It offers more straightforward, intuitive syntax, a wide range of useful libraries (especially for data analysis), and a large community supports it.

  • Python 2 is no longer supported, unlike Python 3. Therefore, for new projects, you only need Python 3. However, if you need to work on projects written in Python 2, you might still need this version, so we will also explain how to install it.

How to Install Python 2

To install Python 2 on Windows 10:

  1. Open your browser and go to the official website python.org.

  2. Go to the Downloads section.

  3. In the Downloads section, find the section for specific releases and locate the version you need.

Image3

  1. The last Python 2 release is 2.7.18. Click on Download and check the related files.

  2. For your operating system, download the 64-bit installer (it is the last file in the list).

Image6

  1. Once the file is downloaded, open it.

  2. Before starting the installation, the installer will allow you to choose the installation path and additional tools. Select the necessary options and start the installation.

How to Install Python 3 on Windows

There are several ways to install Python, each with its own features, advantages, and disadvantages:

  • Full Installation: Installs all components of Python, which is ideal for most projects.

  • Microsoft Store Installation: Suitable for development environments and running scripts.

  • NuGet Package Installation: Python comes as a ZIP file with the .nupkg extension, designed for continuous integration systems. It does not include the user interface. Ideal for building packages and running scripts.

  • Embeddable Package: Installs a minimal version of Python, often used as part of a larger application or project.

Full Installation Using the Official Installer

The steps for installing Python 3 from the official website are similar to those for Python 2. Here’s how to install Python 3 on Windows 10:

  1. Open your browser and go to python.org.

  2. Go to the Downloads section.

  3. Click on Download Python x.x.x (the latest version).

Image5

  1. Once you click it, the installer will start downloading.

  2. After downloading, open the installer.

  3. If Python 3 is already installed, the installer will offer to update it to the version you just downloaded. If Python is not installed, it will offer a fresh installation. Make sure to check the following options:

    • Installing for all users.

    • Add Python to PATH (this allows you to use Python from the command line).

  4. There are two installation options:

    • Install now:
      • Administrator rights are not required.

      • Python will be installed in your user directory.

      • Standard libraries, test suites, a launcher, and pip will be installed.

    • Customize Installation:
      • May require administrator rights.

      • Python will be installed in the Program Files directory.

      • Additional features can be installed.

      • The Python standard library can be precompiled into bytecode.

  1. Choose the option that suits you and start the installation. After it finishes, disable the MAX_PATH length limitation to avoid errors related to file path length.

To check if the installation was successful, run the command python --version in the command line. If everything went well, you should see an output like this:

Python 3.10.8

Python is now installed and ready to use.

Installing Python via Microsoft Store

To install Python from the Microsoft Store:

  1. Open the Microsoft Store application.

  2. In the search bar, type Python 3.x, specifying the version you want (e.g., "Python 3.10").

  3. Click Get.

  4. The download and installation will begin automatically.

Installing Python Using NuGet

To install Python on Windows via NuGet:

  1. Go to the official website and navigate to the Downloads section. Select the recommended version and download it.

  2. After opening the downloaded file, installation will take just a few seconds.

  3. To install Python, open Windows PowerShell and run the following commands:

For the 64-bit version:

nuget.exe install python -ExcludeVersion -OutputDirectory

For the 32-bit version:

nuget.exe install pythonx86 -ExcludeVersion -OutputDirectory

Embeddable Package

The embeddable package provides a minimal Python environment. It is distributed as a ZIP file and is intended to integrate Python into larger applications. The embeddable package is not designed for direct user access.

You will have a fully isolated Python environment when extracted from the archive. It will be isolated from the user’s operating system, including environment variables (like PATH), the system registry, and any installed packages. The standard Python library is included in the embeddable package as compiled and optimized files. However, this version does not include a package manager (pip) or documentation.

You can download the embeddable package from the python.org website:

  1. Go to the Downloads section.

  2. Clicking on Download will download the regular version, so click the hyperlink for Python for Windows instead.

Image4

  1. Click Latest Python 3 Release - Python x.x.x.

Image1

  1. Scroll down to the Files section and choose one of the embeddable versions (for 64-bit or 32-bit systems).

Image2

Conclusion

This guide has covered various methods for installing Python on Windows 10. For more useful Python resources, you can explore our tutorials. If you want to build a web service using Python, you can rent a cloud server at competitive prices with Hostman.

Python Windows
18.10.2024
Reading time: 5 min

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start
Email us