Pip recognize linked site-packages in virtualenv

2019-08-07 14:53发布

问题:

For a number of reasons, such as when the package takes a long time to compile (lxml) it seems to be recommended to symlink such packages from the system sitepackages directory to a virtualenv.

Some example questions:

Use a single site package (as exception) for a virtualenv

How to install lxml into virtualenv from the local system?

But such packages are not recognized by pip, which will happily try to reinstall them. How to deal with this?

回答1:

Okay, it seems the trick is to also link the egg-info directory.