undefined symbol: PyFPE_jbuf error while using 'lxml' on ubuntu

狂风中的少年 提交于 2019-12-10 18:24:43

问题


I am trying to import 'lxml' library into my python program as follows.

from lxml import etree

However, I am getting an error as 'undefined symbol: PyFPE_jbuf'. Here is the entire stack trace

File "xmlExtract.py", line 4, in <module>
from lxml import etree
ImportError: /usr/local/lib/python3.4/dist-packages/lxml/etree.cpython-34m.so: undefined symbol: PyFPE_jbuf

I have carefully installed 'lxml' library including all of its dependencies (libxml2-dev, libxslt-dev, python-dev). I also have older version of python i.e 2.7 along with the new one python3.4. I tried setting variable PYTHONPATH=/usr/local/lib/python3.4/dist-packages but still encountering the above error.

Could someone please help to resolve my issue.


回答1:


I had this same issue, and was able to get past it reinstalling lxml with:

pip install lxml --no-use-wheel

Depending on your version of pip, you may also use:

pip install lxml --no-binary :all:



回答2:


I've just come across this on one of my systems. On my system this comes from switching from system Python to a custom one but keeping the wheels around.

To fix this:

pip uninstall lxml
cd 
find .cache -name 'lxml*cp34*.whl' # check there is a wheel 
find .cache -name 'lxml*cp34*.whl' -delete # remove it
pip install lxml

Thanks to @moo-_- for solving this in another context. See https://stackoverflow.com/a/6893563/2385133 for further details.



来源:https://stackoverflow.com/questions/35852646/undefined-symbol-pyfpe-jbuf-error-while-using-lxml-on-ubuntu

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!