官术网_书友最值得收藏!

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. In Windows, the folder will have the following main subfolders: Include, Lib, Lib\site-packages, and Scripts. The directory trees for the virtual environment in each platform are the same as the layout of the Python installation on these platforms.

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

The following diagram 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 in the lib/python3.6/site-packages or Lib\site-packages folder, based on the platform. The executables will be copied in 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.
主站蜘蛛池模板: 庄浪县| 盘锦市| 临漳县| 清原| 香河县| 拉萨市| 罗甸县| 炎陵县| 大余县| 呼玛县| 菏泽市| 河间市| 镇雄县| 曲阜市| 托克托县| 乌鲁木齐县| 广宁县| 大城县| 亚东县| 金乡县| 云龙县| 凌海市| 大埔县| 从江县| 宜兰县| 克拉玛依市| 靖江市| 枣阳市| 兴海县| 和龙市| 宁德市| 定南县| 渑池县| 左权县| 和顺县| 且末县| 寿阳县| 秀山| 出国| 南涧| 华坪县|