Cố gắng xây dựng lxml trên Python3.4: hệ thống có libxml2 và libxslt.cấu hình mã trả về 256 - python setup.py egg_info không thành công với mã lỗi 1 in/tmp/pip_build_root/lxml
pip xây dựng không thể xác định đa lõi, trong số những thứ khác
phiên bản có liên quan tải (?) (?):
- lxml-3.4.1
- libiconv-1,14
- libxml2-2.9 .2
- libxslt-1.1.28
tiên, hãy thử tiêu chuẩn xây dựng (động):
$ CFLAGS="-O0" pip3 install lxml
xây dựng mà không có lỗi, nhưng:
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
Symbol xuất hiện, tuy nhiên:
$ nm /usr/lib/python3.4/site-packages/lxml/etree.cpython-34m.so | grep __xmlStructuredErrorContext
U __xmlStructuredErrorContext
Nhưng là 'địa phương' trong libxml2 cơ bản:
# nm /usr/lib/libxml2.so.2 | grep __xmlStructuredErrorContext
000d69d0 t __xmlStructuredErrorContext
OK, cố gắng xây dựng TĨNH, như được khuyến khích:
$ 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
More rộng log: http://pastebin.com/P6T246QC
Đối với trường hợp đầu tiên, thư viện nào chứa thư viện 'etree * so' trỏ tới (' ldd ... ')? Đoán của tôi sẽ là 'xmlStructuredErrorContext' bị thiếu trong một, có lẽ vì một trong các thư viện được liên kết đã không dùng nữa trong tương lai, hoặc thay vào đó là thiếu nó vì nó quá cũ. – Evert
cho bản dựng động, nó tìm thấy libs hệ thống - v2.9.2 của libxml2, chẳng hạn. Một áp phích khác cho thấy cờ 'địa phương' trên biểu tượng ở đây có thể là vấn đề? Có lý? # nm /usr/lib/libxml2.so.2 | grep __xmlStructuredErrorContext 000d69d0 t __xmlStructuredErrorContext – DrLou
Thử sử dụng phân phối python như [this] (http://continuum.io/downloads). Giúp tôi với các vấn đề lxml cụ thể, trong số nhiều thứ khác. – bahmait