virtualenv doesn't copy all .py files from the lib/python directory

≯℡__Kan透↙ 提交于 2019-12-04 04:02:36

You wouldn't expect virtualenv make unnecessary full duplicates for your python libraries.

Your Virtual Python still refers and reads library files from your root Python environment. What virtualenv does is it sets your new library install path in the virtual env, so further library installation will be confined in this virtual env.

--always-copy

This option only makes virtualenv copy necessary files rather than symlink.

This is from the manual

--always-copy Always copy files rather than symlinking.

The point is that normally without this option virtualenv should only symlink the minimum required files in order to save space. This option then assures a copy of those files.

It does not say anything about copying the rest of files (esp. extra site packages you installed).

Your need to use --always-copy looks like aside of your new/extra project packages you might also want to use the Python's system site packages.

There is this option for that:

If you build with virtualenv --system-site-packages ENV, your virtual environment will inherit packages from /usr/lib/python2.7/site-packages (or wherever your global site-packages directory is).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!