vendredi 8 mai 2015

Mix Python virtualenv packages with distro packages?

What is a good way to handle the case when you use Python virtualenv but you want some of the packages installed via your distro's package manager?

Let's say you need lxml but because you can't get pip install lxml to work on Ubuntu. and you really don't want to waste time on this, so you just do a apt-get install python-lxml.

Now, you can create a virtaulenv with --system-site-packages and have access to the system-wide installed pre-compiled lxml now. But you'll also drag in all the other system wide packages that you don't need! And yes, there will be quite a bunch of packages that will be installed outside virtualenv, either via sudo pip ... or sudo apt-get python-..., so no "just keep the system clean and install everything you can in virtualenvs, so that --system-site-packages won't drag too many packages with it" is not a solution form me here.

So, is there a way to install just some particular system-site-packages?

Aucun commentaire:

Enregistrer un commentaire