How to Install Python on Windows Server 2016

Install Python on Windows Server 2016 with the official 64-bit installer, PATH setup, virtual environment, verification, and common setup errors.
A glowing amber and blue programming ribbon floats beside a Windows server rack.

To install Python on Windows Server 2016, use the official 64-bit CPython installer, add it to PATH, and create an isolated test environment. The complete setup takes about ten minutes and leaves you with Python, pip, and a repeatable project directory.

Prerequisites

  • A fully updated 64-bit Windows Server 2016 instance. This guide uses the Python 3.13.16 x64 installer, whose official Windows documentation lists Windows 8.1 and newer as supported.
  • An RDP session and a local administrator account, or an account that can approve an elevated installer and open Administrator PowerShell.
  • At least 1 GB of free disk space for Python, pip’s cache, and a small project. Applications with scientific or compiled dependencies need more.
  • Outbound internet access to download the installer and packages from PyPI. A domain name is not required for a local Python installation.
  • A VPSLake Windows RDP server if you need a Windows Server environment with administrator access.

Step 1: Confirm Windows and CPU architecture

The installer must match the server architecture, and the OS check catches a session connected to a different machine before you change anything.

Open Start → Windows PowerShell, right-click it, choose Run as administrator, and run:

Get-CimInstance Win32_OperatingSystem | Select-Object Caption,Version,OSArchitecture

Expected output resembles:

Caption                         Version      OSArchitecture
-------                         -------      --------------
Microsoft Windows Server 2016  10.0.14393  64-bit

Use the 32-bit installer only when the command reports 32-bit or the application has a documented 32-bit dependency. For a normal Server 2016 VPS, continue with the 64-bit installer.

Step 2: Download the official Python installer

The full installer is appropriate for a server because it supports a machine-wide install and does not require the newer Microsoft Store package format.

In the server’s browser, open the Python 3.13.16 release page. In the Files section, download Windows installer (64-bit) and save it in C:\Users\Administrator\Downloads or another folder you control.

Do not download the embeddable package for this setup. It is intended for applications that bundle Python and does not provide the normal pip, PATH, and virtual-environment workflow.

Step 3: Install Python for all users

A machine-wide install puts Python in Program Files, registers the py launcher, and makes the runtime available to services or administrators who need it.

In File Explorer, open the download folder, right-click the installer, and select Run as administrator. In the Python setup window:

  1. Select Customize installation so you can review the features instead of accepting a per-user default.
  2. Leave pip, py launcher, and the standard library selected, then select Next.
  3. On Advanced Options, select Install for all users, Add Python to environment variables, and Precompile standard library. Keep the destination C:\Program Files\Python313 unless your software inventory requires another path.
  4. Select Install, approve User Account Control, and wait for the success message.
  5. Select Disable path length limit if the button appears, then select Close.

The path-length option removes the historical 260-character limit for applications that opt in to long paths. It does not disable Windows security controls or open a firewall port.

For an unattended deployment, run the same installer from elevated PowerShell. Replace PYTHON_INSTALLER with the exact downloaded filename:

Start-Process -FilePath .\PYTHON_INSTALLER.exe -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 Include_test=0' -Wait -PassThru

The process should return an exit code of 0. Close any PowerShell or Command Prompt windows that were open before the installation so they reload the updated PATH.

Step 4: Check Python, pip, and PATH

A fresh terminal confirms that Windows can find the new executable instead of an older copy or an App Execution Alias.

Open a new, non-elevated Windows PowerShell window and run:

python --version
py -3.13 --version
python -m pip --version
Get-Command python | Select-Object Source

The version numbers should identify Python 3.13, and the source should point into C:\Program Files\Python313:

Python 3.13.16
Python 3.13.16
pip 25.x from C:\Program Files\Python313\Lib\site-packages\pip (python 3.13)
Source
------
C:\Program Files\Python313\python.exe

The exact pip patch version can differ as the bundled packaging tools change. Prefer python -m pip over a bare pip command because it guarantees that packages are installed into the interpreter you just selected.

Step 5: Create and run a virtual environment

Virtual environments keep one application’s dependencies away from the machine-wide runtime, which prevents a package upgrade for one project from breaking another.

Create a small project and invoke its interpreter directly so PowerShell execution-policy settings do not affect the test:

New-Item -ItemType Directory -Path C:\PythonApps\hello -Force | Out-Null
Set-Location C:\PythonApps\hello
py -3.13 -m venv .venv
@'
import sys
print(f"Python is working: {sys.version.split()[0]}")
'@ | Set-Content -Encoding UTF8 .\hello.py
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe .\hello.py

Expected output ends with:

Python is working: 3.13.16

For an interactive project session, activate the environment after changing to its folder:

Set-Location C:\PythonApps\hello
.\.venv\Scripts\Activate.ps1
python --version

The prompt normally gains a (.venv) prefix. When finished, run deactivate; the environment remains on disk for the next session.

Verify the Python installation

Run a module import, a pip check, and the test script from the project directory. These checks prove that the interpreter, standard library, packaging tools, and local file execution all work together:

Set-Location C:\PythonApps\hello
.\.venv\Scripts\python.exe -c "import ssl, venv; print('stdlib imports: OK')"
.\.venv\Scripts\python.exe -m pip check
.\.venv\Scripts\python.exe .\hello.py

Expected output is:

stdlib imports: OK
No broken requirements found.
Python is working: 3.13.16

Installing Python does not create a network service, so this guide does not add a Windows Firewall rule. Only open a port later if an application built with Python is deliberately configured to accept remote traffic.

Troubleshooting

python opens the Microsoft Store or is not recognized

The current terminal may have an old PATH, or Windows App Execution Aliases may be taking precedence. Close and reopen PowerShell, then run Get-Command python -All; if the result points to WindowsApps or has no result, rerun the installer with Add Python to environment variables selected and disable the python.exe alias under Settings → Apps → App execution aliases.

py -3.13 reports that no installed Python was found

The Python launcher was not installed, or the installer was run only for another user. Repair Python from Control Panel → Programs → Programs and Features → Python 3.13 → Change, select the launcher and all-users options, then open a new terminal and retry the command.

PowerShell says Activate.ps1 cannot be loaded

The execution policy is blocking the activation script, not the Python runtime. You can keep using the environment directly with C:\PythonApps\hello\.venv\Scripts\python.exe, or allow scripts only for the current PowerShell process:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\.venv\Scripts\Activate.ps1

This temporary setting disappears when that PowerShell window closes. Follow your organization’s execution-policy policy before changing it on a production server.

pip fails while building a package

Some packages contain native extensions and need a compatible prebuilt wheel or a C/C++ build toolchain. First upgrade pip inside the virtual environment, then check the package’s own Windows support matrix; do not install a compiler globally just to fix an unrelated pure-Python package.

.\.venv\Scripts\python.exe -m pip install --upgrade pip setuptools wheel

Hardening

  • Keep Windows Server 2016 patched and restrict RDP to trusted source addresses or a VPN; the OS is approaching the end of its extended-support period.
  • Run applications under a dedicated, least-privileged service account instead of the local Administrator account.
  • Keep each application’s dependencies in its own .venv, pin reviewed versions in requirements.txt, and do not install packages globally with an elevated shell.
  • If a Python application exposes HTTP or another protocol, put it behind TLS and allow only its required port in Server Manager → Tools → Windows Defender Firewall with Advanced Security.

FAQ

Which Python version should I install on Windows Server 2016?

This guide uses the latest Python 3.13 maintenance release available at publication time because its official Windows documentation supports Windows 8.1 and newer and the traditional installer works well for server deployments. Choose the minor version required by your application when its dependencies do not yet support 3.13.

Is Python free for commercial Windows servers?

Yes. The CPython implementation distributed by python.org is open source under the Python Software Foundation License. Review the licenses of third-party packages separately before deploying an application.

Do I need administrator rights to run Python?

No. Administrator approval is useful for a machine-wide install under C:\Program Files, but a user can run Python and use a virtual environment after installation. Keep application files in a directory that the service account can write to without granting it administrator rights.

Does installing Python open a port?

No. Python is an interpreter and does not listen for network connections by itself. A script may start a web server or another listener, but you should expose that service only after configuring authentication, TLS, and a narrowly scoped Windows Firewall rule.

Samrat Ghosh
Written by

Samrat Ghosh

Founder & Infrastructure Engineer

Samrat Ghosh is the founder of VPSLake, where he builds and runs the remote desktop and VPS hosting infrastructure the company is built on. He writes hands-on guides about RDP, Windows Server, VPS management and secure remote access - the practical documentation he wishes had…

Previous Article

How to Install Node.js on Windows Server 2022

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨