【问题标题】:Error when importing lxml objectify and etree in x86_64 Cent OS在 x86_64 Cent OS 中导入 lxml objectify 和 etree 时出错
【发布时间】:2014-09-28 18:19:58
【问题描述】:

我有一个带有 virtualenv 和 python 2.7 的 CentOS 设置。我使用以下方式安装了 lxml:

CFLAGS="$CFLAGS -fPIC -lgcrypt -ldl -lgpg-error -lrt" STATIC_DEPS=true pip2.7 install lxml

它编译和安装没有错误。

但是,当导入 lxml.objectify 时,我的应用程序会中断。进一步调查这个问题,我意识到它的 lxml.objectify 和 lxml.etree 都无法导入。我从 objectify 得到的错误是:

>>> from lxml import objectify
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /var/htdocs/plus.dev/env1/lib/python2.7/site-packages/lxml/objectify.so:     undefined symbol: lzma_auto_decoder

来自etree:

>>> from lxml import etree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /var/htdocs/plus.dev/env1/lib/python2.7/site-packages/lxml/etree.so: undefined symbol: lzma_auto_decoder

我在某些论坛上搜索并卸载了 xz-devel,但我仍然遇到同样的错误,令人沮丧。

可能是什么问题?

【问题讨论】:

    标签: python centos virtualenv lxml


    【解决方案1】:

    经过大量搜索,我终于解决了这个问题。此错误是由 32 位编译的 python 包和 64 位编译的 python 包冲突引起的。在此处获取更详细的描述以及解决方案https://github.com/0xdata/h2o/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only

    【讨论】:

      猜你喜欢
      • 2014-09-01
      • 2013-04-24
      • 2012-08-17
      • 2021-05-29
      • 2014-03-13
      • 2019-11-11
      • 2017-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多