🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Python Virtual Environments and Package Management: pip, venv, Poetry, and Conda

Python Virtual Environments and Package Management: pip, venv, Poetry, and Conda

Python offers multiple package management tools, each solving different problems.

pip + venv

python3 -m venv .venv
source .venv/bin/activate
pip install flask sqlalchemy
pip freeze > requirements.txt

Poetry

poetry new my-project
poetry add flask sqlalchemy
poetry add --group dev pytest black
poetry install
poetry run python app.py

Conda

conda create -n myproject python=3.12
conda activate myproject
conda install numpy pandas scikit-learn
conda env export > environment.yml

Comparison

Featurepip+venvPoetryConda
Lock fileManualpoetry.lockenvironment.yml
Non-Python depsNoNoYes
Best forSimpleLibraries/appsData science

Master Python with our Python eBook collection.

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.