2

I tried to switch to python 2.7.10 but failed on trying to import lxml.etree.

I made small edits to this guide in order to install python 2.7.10

./configure --prefix /usr/local/lib/python-2.7.10
make
make install

After that I made virtualenv based on this python folder

mkvirtualenv --python=/usr/local/lib/python-2.7.10/bin/python Py2710VirtEnv

Installed all the necessary lxml prerequisites and lxml itself

apt-get install libxml2-dev libxslt1-dev python-dev
CFLAGS="-O0" pip install lxml

When I start python under Py2710VirtEnv I get the right version number (Python 2.7.10).

import lxml also works fine.

But when I type from lxml import etree I get an error

Traceback (most recent call last): File "stdin", line 1, in ImportError: /root/Envs/Py2710VirtEnv/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: PyFPE_jbuf

I looked over a couple of question about lxml.etree ImportError but I didn't find the suitable answer. Everything works perfectly well on virtualenv with py 2.7.6

So I have two major questions:

  1. (obvious) about the error itself
  2. (general) is it a right way to install and use python 2.7.10 with virtualenv?
1
  • Importing lxml and then calling lxml.etree doesn't work, right? Jan 22, 2016 at 16:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.