Understanding the directory structure for a virtual environment

The specified target folder has a new directory tree that contains Python-executable files and other files that indicate it is a PEP405 virtual environment.

In the root directory for the virtual environment, the pyenv.cfg configuration file specifies different options for the virtual environment and its existence is an indicator that we are in the root folder for a virtual environment. In Linux and macOS, the folder will have the following main subfolders: bin, include, lib, lib/python3.6, and lib/python3.6/site-packages. Note that the folder names can be different based on the specific Python version. In Windows, the folder will have the following main subfolders: Include, Lib, Libsite-packages, and Scripts. The directory trees for the virtual environment in each platform are the same as the layout of the Python installation in these platforms.

The following screenshot shows the folders and files in the directory trees generated for the 01 virtual environment in macOS and Linux platforms:

The following screenshot shows the main folders in the directory trees generated for the virtual environment in Windows:

After we activate the virtual environment, we will install third-party packages into the virtual environment and the modules will be located within the lib/python3.6/site-packages or Libsite-packages folder, based on the platform and the specific Python version. The executables will be copied to the bin or Scripts folder, based on the platform. The packages we install won't make changes to other virtual environments or our base Python environment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.126.5