Find us on social media
PythonWindowsPip4 min read
Install Python on Windows Server
Install Python on Windows Server with pip and virtual environments for scripts and applications.
Python is widely used for automation, web applications and data processing. This guide covers installation on Windows Server.
Method 1 — Official installer (recommended)
Download and install Python:
powershell
# Download Python installer
Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.12.1/python-3.12.1-amd64.exe" -OutFile "C:\temp\python-installer.exe"
# Silent install with PATH
C:\temp\python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0Method 2 — Using winget
powershell
winget install Python.Python.3.12Method 3 — Using Chocolatey
powershell
choco install python --version=3.12.1 -yVerify the installation
Open a new PowerShell window:
powershell
python --version
pip --versionAdd to PATH (if needed)
powershell
$pythonPath = "C:\Program Files\Python312;C:\Program Files\Python312\Scripts"
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$pythonPath", "Machine")Create a virtual environment
powershell
mkdir C:\apps\myproject
cd C:\apps\myproject
python -m venv venvActivate the virtual environment:
powershell
.\venv\Scripts\Activate.ps1If you get an execution policy error:
powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserInstall packages
powershell
pip install flask gunicorn requests
pip freeze > requirements.txt
pip install -r requirements.txtDeactivate the environment
powershell
deactivateRun a Python web application
powershell
# Install Flask
pip install flask
# Create app.py
Set-Content -Path "C:\apps\myproject\app.py" -Value "from flask import Flask`napp = Flask(__name__)`n@app.route('/')`ndef hello():`n return 'Hello from Baires Host!'`nif __name__ == '__main__':`n app.run(host='0.0.0.0', port=5000)"
# Run
python app.pyTip
For production Python web apps on Windows, use IIS with the wfastcgi module or run behind IIS as a reverse proxy. Always use virtual environments to isolate project dependencies on your Baires Host VPS.
Was this guide helpful?