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
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
© 2025 OneMinuteCode. All rights reserved.