Creating Python Virtual Environment and Managing Dependency

What is virtual environment?

At its core, the main purpose of Python virtual environments is to create an isolated environment for Python projects. This means that each project can have its own dependencies, regardless of what dependencies every other project has.

Tools with functionality to create and manage virtual environments:

  • venv (part of the standard library)

What is dependecy management?

Dependency management is the keystone of a sustainable, secure project for Python. If your dependencies are well managed, you won’t find yourself on the wrong end of a long-term support timeline or have dependencies that are out of step with one another. It is a concept that is difficult to grasp in the beginning but indispensable afterwards.

What is the relationship between Virtual Environments and Package Management Tools?

  • venv and virtualenv use pip as a package management tool.

Conda Usage

Conda: package and venv management tool (anaconda repository)

  • install package: conda install package_name

References:

https://www.veribilimiokulu.com/python-virtual-environment-nedir/

https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda