if you donโt need a specific version from PyPI, you can always use the version packaged for Ubuntu.
$ sudo apt-get install python-lxml
... and then allow system site packages in your virtual directory.
update:
to clarify ... By default, python packages are installed from PyPI. However, many python packages are also packaged for Ubuntu and stored in Ubuntu archives, you can install them through the system package manager (apt-get) instead of using pip. This can be useful since Ubuntu packages are already compiled and will pull any dependencies they need.
By default, virtualenv creates a python sandbox, so you donโt have access to the system packages (which you installed with apt-get). However, you can enable system site packages in your virtual directory.
for example, let it install lxml from it into a system package, create a virtualenv named "ENV", which allows access to system packages, and then import lxml to check its functionality:
$ sudo apt-get install python-lxml $ virtualenv --system-site-packages ENV $ source ENV/bin/activate (ENV)$ python -c "import xml"
Corey goldberg
source share