2014-12-19 65 views
11

尝试在Python3.4上构建lxml:系统具有libxml2和libxslt。配置返回的代码256 - python setup.py egg_info失败,错误代码1在/ tmp/pip_build_root/lxml中

PIP构建不能确定多核,除其他事项外

相关版本下载(?)(?):

  • LXML-3.4.1
  • libiconv的1.14
  • libxml2-2.9 0.2
  • 的libxslt-1.1.28

首先,尝试标准版本(动态):

$ CFLAGS="-O0" pip3 install lxml 

建立没有错误,但:

Python 3.4.2 (default, Dec 13 2014, 16:48:48) 
[GCC 4.8.3] on sunos5 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from lxml import etree 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: ld.so.1: isapython3.4: fatal: relocation error: file /usr/lib/python3.4/site-packages/lxml/etree.cpython-34m.so: symbol __xmlStructuredErrorContext: referenced symbol not found 

符号出现,但是:

$ nm /usr/lib/python3.4/site-packages/lxml/etree.cpython-34m.so | grep __xmlStructuredErrorContext 
     U __xmlStructuredErrorContext 

不过是 '本地'在底层libxml2中:

# nm /usr/lib/libxml2.so.2 | grep __xmlStructuredErrorContext 
000d69d0 t __xmlStructuredErrorContext 

OK,尝试建立STATIC,如建议

$ STATIC_DEPS=true CFLAGS="-O0" pip3 install lxml 

...

**Exception: Command "make -j6" returned code 256** 

Building lxml version 3.4.1. 

Latest version of libiconv is 1.14 
Latest version of libxml2 is 2.9.2 
Latest version of libxslt is 1.1.28 
... 

Starting build in build/tmp/libiconv-1.14 

---------------------------------------- 
Cleaning up... Removing temporary dir /tmp/pip_build_root... 

Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/lxml 

Exception information: 
Traceback (most recent call last): 
    File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line 278, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/lib/python3.4/site-packages/pip/req.py", line 1229, in prepare_files 
    req_to_install.run_egg_info() File "/usr/lib/python3.4/site-packages/pip/req.py", line 325, in run_egg_info command_desc='python setup.py egg_info') 
    File "/usr/lib/python3.4/site-packages/pip/util.py", line 697, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/lxml 

更广泛的日志:http://pastebin.com/P6T246QC

+0

对于第一种情况,'etree * so'库指向哪个库('ldd ...')?我的猜测是'xmlStructuredErrorContext'缺少一个,可能是因为其中一个链接库已经被弃用,或者因为它太旧而错过了。 – Evert

+0

为动态构建,例如,它找到libxml2的系统库 - v2.9.2。 另一张海报表明这个符号上的'本地'标志可能是问题所在?合理? #nm /usr/lib/libxml2.so.2 | grep __xmlStructuredErrorContext 000d69d0 t __xmlStructuredErrorContext – DrLou

+0

尝试使用像[this]这样的python发行版(http://continuum.io/downloads)。特别帮助我解决lxml问题,以及许多其他问题。 – bahmait

回答

0

我的注意力被这个错误捕获:

**Exception: Command "make -j6" returned code 256** 

试图改变自己的安装命令是:

STATIC_DEPS=true CFLAGS="-O0" pip3 install lxml --install-option="--multicore=1" 

Altough这是一个老问题,我希望这可以帮助别人。

相关问题