
上QQ阅读APP看书,第一时间看更新
Creating virtual environments with venv
A virtual environment is a clone of a Python installation stored in a local folder. The Python executables and packages are not really copied, but symbolic links to the original files are created and environment variables are adjusted to set up a consistent Python filesystem. Once activated, a virtual environment will install packages in local directories without modifying the global Python installation.
A virtual environment is also the recommended setup for development in Python. With a virtual environment, it becomes easy to isolate the packages required to install the software under development.
If you are using Anaconda, do not create virtual environments using venv. Instead, use conda, as described in the previous section.