4. Using Python on Windows — Python 3.13.18 documentation
Navigation index modules | next | previous | Python » 3.13.18 Documentation » Python Setup and Usage » 4. Using Python on Windows | Theme | 4. Using Python on Windows ¶ This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix systems and services, Windows does not include a system supported installation of Python. To make Python available, the CPython team has compiled Windows installers with every release for many years.
These installers are primarily intended to add a per-user installation of Python, with the core interpreter and library being used by a single user. The installer is also able to install for all users of a single machine, and a separate ZIP file is available for application-local distributions. As specified in PEP 11 , a Python release only supports a Windows platform while Microsoft considers the platform under extended support.
This means that Python 3.13 supports Windows 8.1 and newer. If you require Windows 7 support, please install Python 3.8. There are a number of different installers available for Windows, each with certain benefits and downsides. The full installer contains all components and is the best option for developers using Python for any kind of project. The Microsoft Store package is a simple installation of Python that is suitable for running scripts and packages, and using IDLE or other development environments.
It requires Windows 10 and above, but can be safely installed without corrupting other programs. It also provides many convenient commands for launching Python and its tools. The nuget.org packages are lightweight installations intended for continuous integration systems. It can be used to build Python packages or run scripts, but is not updateable and has no user interface tools. The embeddable package is a minimal package of Python suitable for embedding into a larger application.
4.1. The full installer ¶ 4.1.1. Installation steps ¶ Four Python 3.13 installers are available for download - two each for the 32-bit and 64-bit versions of the interpreter. The web installer is a small initial download, and it will automatically download the required components as necessary. The offline installer includes the components necessary for a default installation and only requires an internet connection for optional features.
See Installing Without Downloading for other ways to avoid downloading during installation. After starting the installer, one of two options may be selected: If you select “Install Now”: You will not need to be an administrator (unless a system update for the C Runtime Library is required or you install the Python Launcher for Windows for all users) Python will be installed into your user directory The Python Launcher for Windows will be installed according to the option at the bottom of the first page The standard library, test suite, launcher and pip will be installed If selected, the install directory will be added to your PATH Shortcuts will only be visible for the current user Selecting “Customize installation” will allow you to select the features to install, the installation location and other options or post-install actions.
To install debugging symbols or binaries, you will need to use this option. To perform an all-users installation, you should select “Customize installation”. In this case: You may be required to provide administrative credentials or approval Python will be installed into the Program Files directory The Python Launcher for Windows will be installed into the Windows directory Optional features may be selected during installation The standard library can be pre-compiled to bytecode If selected, the install directory will be added to the system PATH Shortcuts are available for all users 4.1.2.
Removing the MAX_PATH Limitation ¶ Windows historically has limited path lengths to 260 characters. This meant that paths longer than this would not resolve and errors would result. In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set LongPathsEnabled to 1 in the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem .
This allows the open() function, the os module and most other path functionality to accept and return paths longer than 260 characters. After changing the above option, no further configuration is required. Changed in version 3.6: Support for long paths was enabled in Python. 4.1.3. Installing Without UI ¶ All of the options available in the installer UI can also be specified from the command line, allowing scripted installers to replicate an installation on many machines without user interaction.
These options may also be set without suppressing the UI in order to change some of the defaults. The following options (found by executing the installer with /? ) can be passed into the installer: Name Description /passive to display progress without requiring user interaction /quiet to install/uninstall without displaying any UI /simple to prevent user customization /uninstall to remove Python (without confirmation) /layout [directory] to pre-download all components /log [filename] to specify log files location All other options are passed as name=value , where the value is usually 0 to disable a feature, 1 to enable a feature, or a path.
The full list of available options is shown below. Name Description Default InstallAllUsers Perform a system-wide installation. 0 TargetDir The installation directory Selected based on InstallAllUsers DefaultAllUsersTargetDir The default installation directory for all-user installs %ProgramFiles%\Python X.Y or %ProgramFiles(x86)%\Python X.Y DefaultJustForMeTargetDir The default install directory for just-for-me installs %LocalAppData%\Programs\Python\PythonXY or %LocalAppData%\Programs\Python\PythonXY-32 or %LocalAppData%\Programs\Python\PythonXY-64 DefaultCustomTargetDir The default custom install directory displayed in the UI (empty) AssociateFiles Create file associations if the launcher is also installed.
1 CompileAll Compile all .py files to .pyc . 0 PrependPath Prepend install and Scripts directories to PATH and add .PY to PATHEXT 0 AppendPath Append install and Scripts directories to PATH and add .PY to PATHEXT 0 Shortcuts Create shortcuts for the interpreter, documentation and IDLE if installed. 1 Include_doc Install Python manual 1 Include_debug Install debug binaries 0 Include_dev Install developer headers and libraries.
Omitting this may lead to an unusable installation. 1 Include_exe Install python.exe and related files. Omitting this may lead to an unusable installation. 1 Include_launcher Install Python Launcher for Windows . 1 InstallLauncherAllUsers Installs the launcher for all users. Also requires Include_launcher to be set to 1 1 Include_lib Install standard library and extension modules. Omitting this may lead to an unusable installation.
1 Include_pip Install bundled pip and setuptools 1 Include_symbols Install debugging symbols ( *.pdb ) 0 Include_tcltk Install Tcl/Tk support and IDLE 1 Include_test Install standard library test suite 1 Include_tools Install utility scripts 1 LauncherOnly Only installs the launcher. This will override most other options. 0 SimpleInstall Disable most install UI 0 SimpleInstallDescription A custom message to display when the simplified install UI is used. (empty) For example, to silently install a default, system-wide Python installation, you could use the following command (from an elevated command prompt): python-3.9.0.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 To allow users to easily install a personal copy of Python without the test suite, you could provide a shortcut with the following command.
This will display a simplified initial page and disallow customization: python-3.9.0.exe Insta
The rest of this page is on the live site.