How to Install Python on Windows Server 2022

Install Python on Windows Server 2022 with the official Python manager, PATH, pip, virtual environments, verification, and practical error fixes.
A glowing blue and amber programming ribbon floats beside a Windows Server tower in a dark data center.

To install python on windows server 2022, use the official Python install manager, add a supported Python runtime, and test it in an isolated virtual environment. The setup takes about ten minutes and leaves you with Python, pip, and a clean project directory ready for your application.

Prerequisites

  • A patched, 64-bit Windows Server 2022 installation. This guide installs the current Python 3.14 runtime line through the Python install manager.
  • An RDP session with a local administrator account, or an account allowed to install applications and open PowerShell.
  • At least 1 GB of free disk space for the runtime, pip cache, and test project, plus outbound HTTPS access to Python.org and PyPI.
  • A domain name is not needed for Python itself. You need one only if a Python web application will be published publicly.
  • A VPSLake Windows RDP server if you need a Windows environment with administrator access.

Step 1: Confirm Windows Server 2022 and the architecture

Checking the operating system before installing prevents a package intended for another server or CPU architecture from being selected.

Open Start → Windows PowerShell, then run:

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

Expected output resembles:

Caption                         Version        OSArchitecture
-------                         -------        --------------
Microsoft Windows Server 2022  10.0.20348    64-bit

Continue only when the caption identifies Windows Server 2022 and OSArchitecture is 64-bit. The current Python Windows packages are primarily x64; do not use an x64 package on a 32-bit server.

Step 2: Install the official Python install manager

Windows Server 2022 supports the current MSIX-based Python install manager, which keeps the runtime selection separate from the manager itself and avoids third-party download sites.

Open the Python 3.14.8 release page in the RDP session. Under Files → Windows, select Download Python install manager, open the downloaded MSIX file, and select Install. If the server has WinGet available, the same official package can be installed from an elevated PowerShell window:

winget install 9NQ7512CXL7T -e --accept-package-agreements --disable-interactivity

Open a new PowerShell window after the manager finishes. The install manager is per-user, so install it while signed in as the Windows account that will run the Python application. The official Python Windows documentation explains the manager, its py commands, and the supported fallback for environments that cannot install MSIX.

Step 3: Add Python 3.14 to the server

The manager is only the control tool; this command downloads and registers the Python runtime that your scripts will use.

Run these commands in the new PowerShell window:

py install --configure -y
py install 3.14
py list --one 3.14

The first command applies the recommended command aliases, the second installs the latest available Python 3.14 maintenance release, and the last prints the runtime selected by the manager. It should show a 3.14 runtime with an x64 architecture.

Now check the interpreter and pip:

py -V:3.14 --version
python --version
python -m pip --version

Expected output is similar to this; the maintenance number and pip path may change:

Python 3.14.8
Python 3.14.8
pip 25.x from C:\Users\YOUR_USER\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\pip (python 3.14)

Use python -m pip instead of a bare pip command. That form ties package operations to the interpreter you just selected, which matters when more than one Python version is installed.

Step 4: Create a virtual environment and run a test script

A virtual environment isolates application packages from the base runtime, so an upgrade for one project does not unexpectedly change another project on the server.

Create a small test application in PowerShell:

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

The final line should print:

Python is working: 3.14.8

The exact patch version can differ when the install manager receives a newer 3.14 release. To work interactively inside this project, activate its environment:

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

PowerShell normally adds (.venv) to the prompt while the environment is active. Calling the environment’s executable directly, as shown above, also works when your execution policy prevents activation scripts.

Verify the Python installation

Run the interpreter, standard-library, and dependency checks from the project folder. These checks prove that Python can execute code, import SSL support, create virtual environments, and resolve pip dependencies:

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 ends with:

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

Python does not open an inbound port during installation, so no Windows Firewall rule is needed for this test. If your application later listens for web traffic, create a narrow rule in Server Manager → Tools → Windows Defender Firewall with Advanced Security, bind the service deliberately, and place public HTTP behind TLS.

Troubleshooting

py is not recognized or launches an older launcher

An earlier Python launcher may still be earlier in PATH, or the new manager was installed for another Windows user. Run Get-Command py -All, remove the old Python Launcher from Settings → Apps → Installed apps, then open a new PowerShell window. If the manager command is available under its unambiguous name, use pymanager in place of py.

python opens the Microsoft Store or is not recognized

The current terminal may have an old PATH, or Windows App Execution Aliases may be intercepting the command. Open a new shell, run Get-Command python -All, and disable the python.exe alias under Settings → Apps → App execution aliases if it points to WindowsApps; py -V:3.14 --version remains a reliable check.

No module named pip

You may be calling a different interpreter than the one that created the environment, or pip was removed from that runtime. Check the selected interpreter and restore pip with:

python -m ensurepip --upgrade
python -m pip install --upgrade pip

Inside a virtual environment, use .\.venv\Scripts\python.exe -m ensurepip --upgrade so the repair is applied to that environment rather than globally.

The MSIX package will not install

Application-install policies, a missing App Installer component, or a restricted server image can block MSIX. Use the Windows installer (64-bit) from the same Python release page instead, select Customize installation, keep pip and the launcher enabled, select Add Python to environment variables, and then open a new PowerShell window. This traditional installer is also the documented fallback for deployments that cannot use MSIX.

Activate.ps1 is blocked by PowerShell

The execution policy is blocking the activation script, not Python. Use the environment executable directly, or allow scripts only for the current PowerShell process:

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

The process-scoped setting disappears when that PowerShell window closes. Follow your organization’s policy before changing a broader execution-policy scope.

Hardening

  • Keep Windows Server 2022 patched and restrict RDP to trusted addresses or a VPN.
  • Run production code under a dedicated, least-privileged Windows account instead of Administrator.
  • Keep every application in its own .venv, review dependency changes, and avoid installing unreviewed packages into the base runtime.
  • Do not expose a Python development server directly to the internet. Use a supported production server behind TLS and allow only the required firewall port.

FAQ

Which Python version should I install on Windows Server 2022?

Use the current stable 3.14 maintenance release unless your application or dependency vendor specifies another minor version. The py install 3.14 command tracks that line without requiring you to hard-code a changing patch filename. For an application that requires Python 3.13, use py install 3.13 and create its environment with py -V:3.13 -m venv .venv.

Is the Python install manager the same as Python?

No. The manager installs and selects Python runtimes; py and python then launch the runtime. Installing the manager alone is not enough, so complete the py install 3.14 step before testing pip or creating a virtual environment.

Can I install Python without administrator access?

The install manager and its runtime are normally installed for the signed-in user, so a per-user setup may not need elevation. You still need permission to install applications on the server, and every Windows account or service identity that runs Python must have its own accessible runtime or an approved shared deployment.

Does installing Python open a firewall port?

No. Python is an interpreter and does not listen for network connections by itself. A later script may start a web server or another listener, but expose it 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 Python on Windows Server 2019

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 ✨