Zum Inhalt springen
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
Referenzen Technologien Blog Know-how Tools
Über uns Zusammenarbeit Karriere
CS EN DE
Lassen Sie uns sprechen

Python Virtual Environments

02. 10. 2019 1 Min. Lesezeit intermediate

Bez virtual environment sdílíte závislosti mezi projekty. To vede k version conflictům a ‘works on my machine’.

venv — vestavěný

python -m venv .venv source .venv/bin/activate # Linux/Mac .venv\Scripts\activate # Windows pip install -r requirements.txt deactivate

uv — moderní alternativa

Instalace

curl -LsSf https://astral.sh/uv/install.sh | sh

Použití

uv venv uv pip install flask uv pip compile requirements.in -o requirements.txt

Best practices

  • .venv v .gitignore
  • requirements.txt nebo pyproject.toml
  • Lock file (uv.lock, poetry.lock)
  • Jedna env per projekt

Klíčový takeaway

Vždy virtual environment. uv je rychlejší než pip, poetry pro komplexní projekty.

pythonvenvvirtualenv
Teilen:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.