PEP405 提出为Python增加一个自带site directories的轻量级虚拟环境(virtual environments)机制。列出PEP405英文部分摘要
This PEP proposes to add to Python a mechanism for lightweight “virtual environments” with their own site directories, optionally isolated from system site directories. Each virtual environment has its own Python binary (allowing creation of environments with various Python versions) and can have its own independent set of installed Python packages in its site directories, but shares the standard library with the base installed Python.
该提案围绕寻找sys.prefix
的值展开,新添了一步以寻找pyvenv.cfg
文件判断sys.prefix
值的操作规范。下面就绘制出流程图: