PythonWindowsPip5 min de lectura

Instalar Python en Windows Server

Instalá Python en Windows Server con pip y entornos virtuales para scripts y aplicaciones.


Python es esencial para scripts de automatización, aplicaciones web y herramientas de administración.

Paso 1 — Descargar Python

powershell
New-Item -Path "C:\PythonSetup" -ItemType Directory -Force
Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.12.0/python-3.12.0-amd64.exe" -OutFile "C:\PythonSetup\python-setup.exe"

Paso 2 — Instalar con PATH configurado

Instalación silenciosa con todas las opciones:

powershell
Start-Process "C:\PythonSetup\python-setup.exe" -ArgumentList '/quiet InstallAllUsers=1 PrependPath=1 Include_pip=1' -Wait

Paso 3 — Verificar la instalación

Cerrá y reabrí PowerShell:

powershell
python --version
pip --version

Paso 4 — Actualizar pip

powershell
python -m pip install --upgrade pip

Paso 5 — Crear un entorno virtual

powershell
mkdir C:\apps\mi-proyecto
cd C:\apps\mi-proyecto
python -m venv .venv

Activar el entorno:

powershell
.venv\Scripts\Activate.ps1

Si da error de ejecución de scripts:

powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.venv\Scripts\Activate.ps1

Paso 6 — Instalar dependencias

powershell
pip install flask gunicorn sqlalchemy
pip freeze > requirements.txt

Paso 7 — Verificar el PATH

Si python no se reconoce:

powershell
$pythonPath = "C:\Program Files\Python312;C:\Program Files\Python312\Scripts"
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$pythonPath", "Machine")

Ejecutar como servicio

Para ejecutar una app Python como servicio de Windows, podés usar NSSM:

powershell
# Descargar NSSM
Invoke-WebRequest -Uri "https://nssm.cc/release/nssm-2.24.zip" -OutFile "C:\nssm.zip"
Expand-Archive "C:\nssm.zip" -DestinationPath "C:\nssm"

# Instalar servicio
C:\nssm\nssm-2.24\win64\nssm.exe install MiAppPython "C:\apps\mi-proyecto\.venv\Scripts\python.exe" "C:\apps\mi-proyecto\app.py"
Start-Service MiAppPython

Buenas prácticas

  • Siempre usá entornos virtuales
  • No instalés paquetes globalmente con pip
  • Usá requirements.txt para reproducibilidad

¿Te resultó útil esta guía?