您的位置:首页 > 编程语言 > Python开发

PEP405 规范流程图

2016-10-30 16:23 176 查看
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
值的操作规范。下面就绘制出流程图:

Created with Raphaël 2.1.0prefix 相关值未确定pyvenv.cfg文件是否被找到home=h-value 格式是否被找到sys.prefix = path/to/directory of pyvenv.cfg sys.base_prefix = h-valueprefix 相关值确定sys.prefix与sys.base_prefix等值yesnoyesno

site
模块和
sysconfig
模块通过
sys.base_prefix
/
sys.base_exec_prefix
来确定Python标准库和头文件位置,通过
sys.prefix
/
sys.exec_prefix
来确定
site-packages
目录的位置。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python PEP