且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查virtualenv是否使用'--no-site-packages'创建?

更新时间:2023-10-23 12:27:34

< env> /lib/pythonX.X / code>当您使用创建虚拟环境时,调用 no-global-site-packages.txt - no-site-packages

There's a file in <env>/lib/pythonX.X/ called no-global-site-packages.txt when you create a virtual environment with --no-site-packages.

只需使用virtualenv 1.7:

Just tried this with virtualenv 1.7:

% virtualenv --no-site-packages env.without
% virtualenv --system-site-packages env.with

% find env.without | sed 's/env.without//' > files.without
% find env.with | sed 's/env.with//' > files.with

% diff files.with*
230a231
> /lib/python3.2/no-global-site-packages.txt