Python: pip install lxml from source using pip and cython

204 views Asked by At

I'm running a virtual environment on ubuntu and would like to install lxml from source with cython for better performance using lxml.

Normally install lxml using cython from source is straightforward

python setup.py build --with-cython

To install via PIP from source you would run

pip install -e setup.py

How do you combine the two? This is an issue because I can't get lxml installed this way into my virtualenv and will loose the performance boost by installing via a traditional pip install lxml.

1

There are 1 answers

1
MattDMo On

Assuming you're using the latest version of pip (currently 7.0.3, upgrade with [sudo] pip install -U pip), you should be able to use the --global-option <options> flag to pass parameters to setup.py before the install command is run.