Installing both lxml 3.1.2 and lxml2 on ubuntu 12.04
Posted
by
wgw
on Ask Ubuntu
See other posts from Ask Ubuntu
or by wgw
Published on 2013-11-08T21:00:10Z
Indexed on
2013/11/08
22:16 UTC
Read the original article
Hit count: 315
I asked this on SO: http://stackoverflow.com/questions/19852911/lxml-3-1-2-and-lxml2-both-on-ubuntu/19856674#19856674
But it is perhaps more appropriate for AskUbuntu. So here it is again, reformulated.
On the lxml site they suggest that it is possible to have both lxml2 and the newest version of lxml on ubuntu:
Using lxml with python-libxml2
If you want to use lxml together with the official libxml2 Python bindings (maybe because one of your dependencies uses it), you must build lxml statically. Otherwise, the two packages will interfere in places where the libxml2 library requires global configuration, which can have any kind of effect from disappearing functionality to crashes in either of the two. To get a static build, either pass the --static-deps option to the setup.py script, or run pip with the STATIC_DEPS or STATICBUILD environment variable set to true, i.e. STATIC_DEPS=true pip install lxml The STATICBUILD environment variable is handled equivalently to the STATIC_DEPS variable, but is used by some other extension packages, too.
I am generally confused about how pip packages and ubuntu packages get along, so I hesitate to run STATIC_DEPS=true pip install lxml. Will it damage/confuse my installed lxml2 package?
The suggestion on SO was to install the new lxml in a virtualenv. That looks like the best way to go, but the lxml site is suggesting that a dual installation will work also.
In general: what happens if I use pip (to get a newer install) for a package that is already installed by apt-get?
© Ask Ubuntu or respective owner