Is the library the only thing that Python venv makes independent?

Asked 1 years ago, Updated 1 years ago, 67 views

I recently started using venv, but I have one question.Is it correct to understand that even if it is independent of other python environments, python libraries are independent, and other libraries (e.g., C compiler, etc.) are common?

python python3 python-venv

2022-09-30 21:37

1 Answers

Python libraries are independent, but other libraries (e.g., C compiler) are common

Generally speaking, that is correct.To be exact, Python binaries in addition to libraries can be independent.

The behavior of a virtual environment created by venv is to specify a Python or pip version (by symbolic link or binary copy) and install the corresponding library in that virtual environment.

The venv module provides support for creating a lightweight "virtual environment".A virtual environment has a site directory for each virtual environment, which can be isolated from the site directory of the system.Each virtual environment has its own Python binaries (which can be created in various Python versions) that allow you to install a separate set of Python packages in the site directory for each virtual environment.

venv---Creating a Virtual Environment—Python 3.7.2 Documentation


2022-09-30 21:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.