Tôi đang xây dựng lxml trên Mac OS X 10.8.1 và Python 2.7.2 và gặp sự cố. (Tôi đã nhân bản kho lưu trữ Github và làm theo hướng dẫn dành cho Mac OS X tại đây: http://lxml.de/build.html)Tôi đang làm gì sai khi cài đặt lxml trên Mac OS X 10.8.1?
Có vẻ như có gì đó bị treo trong xây dựng libxml2; sau đây là phần đuôi cuối đầu ra thiết bị đầu cuối:
configure: creating ./config.status
config.status: creating libxml2.spec
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating include/libxml/Makefile
config.status: creating doc/Makefile
config.status: creating doc/examples/Makefile
config.status: creating doc/devhelp/Makefile
config.status: creating example/Makefile
config.status: creating python/Makefile
config.status: creating python/tests/Makefile
config.status: creating xstc/Makefile
config.status: creating include/libxml/xmlversion.h
config.status: creating xml2-config
config.status: creating libxml-2.0.pc
config.status: creating libxml-2.0-uninstalled.pc
config.status: creating python/setup.py
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
rm: libtoolT: No such file or directory
Done configuring
make all-recursive
Making all in include
Making all in libxml
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all-am'.
Making all in .
CC error.lo
[snipped]
CC hash.lo
parser.c: In function 'xmlParseInNodeContext':
parser.c:13492: warning: pointer targets in passing argument 1 of 'xmlFindCharEncodingHandler' differ in signedness
CC list.lo
[snipped]
CC xpointer.lo
xpath.c: In function 'xmlXPathRegisterFuncNS':
xpath.c:4870: warning: ISO C forbids passing argument 4 of 'xmlHashAddEntry2' between function pointer and 'void *'
xpath.c: In function 'xmlXPathFunctionLookupNS':
xpath.c:4951: warning: ISO C forbids assignment between function pointer and 'void *'
xpath.c: In function 'xmlXPathCompOpEval':
xpath.c:13535: warning: ISO C forbids assignment between function pointer and 'void *'
xpath.c:13562: warning: ISO C forbids assignment between function pointer and 'void *'
xpath.c: At top level:
trionan.c:221: warning: 'trio_is_negative' defined but not used
CC xinclude.lo
[snipped]
CC xmlstring.lo
threads.c: In function 'xmlCleanupThreads':
threads.c:918: error: expected expression before '{' token
make[2]: *** [threads.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 225, in <module>
**setup_extra_options()
File "setup.py", line 139, in setup_extra_options
STATIC_CFLAGS, STATIC_BINARIES)
File "/Users/jedc/Downloads/lxml/setupinfo.py", line 57, in ext_modules
multicore=OPTION_MULTICORE)
File "/Users/jedc/Downloads/lxml/buildlibxml.py", line 338, in build_libxml2xslt
cmmi(libxml2_configure_cmd, libxml2_dir, multicore, **call_setup)
File "/Users/jedc/Downloads/lxml/buildlibxml.py", line 266, in cmmi
cwd=build_dir, **call_setup)
File "/Users/jedc/Downloads/lxml/buildlibxml.py", line 249, in call_subprocess
raise Exception('Command "%s" returned code %s' % (cmd_desc, returncode))
Exception: Command "make -j5" returned code 512
tôi m WAY bên ngoài chiều sâu của tôi trong việc cố gắng tìm ra có gì sai ở đây Có ai có thể chỉ cho tôi theo hướng tôi cần làm để sửa lỗi này không?
Wow, cảm ơn rất nhiều vì câu trả lời vô cùng toàn diện! Tôi biết tôi đã thử sử dụng pip lúc đầu nhưng nó không hoạt động; Tôi đã thử nó ngay bây giờ và nó đã hoàn thành thành công. (Đầu ra đầu cuối ở cuối = "Cài đặt thành công lxml") Nhưng khi tôi đi vào python và gõ "import lxml" tôi nhận được "ImportError: No module named lxml". Bất kỳ ý tưởng về những gì tôi đang làm sai? –
Bạn có cài đặt không phải của Apple Python nào không? Có thể bạn đang chạy phiên bản pip và python không khớp. Một điều khá phổ biến là bạn kết thúc với/usr/local/bin/pip (hoặc/opt/local/bin/pip, vv) làm pip đầu tiên trên đường dẫn của bạn, và nó cài đặt các module cho/usr/local/bin/python, nhưng sau đó/usr/bin/python là python đầu tiên. – abarnert
Rất có thể tôi đã xoay xở để khắc phục điều đó vào một thời điểm nào đó. Làm thế nào tôi có thể chẩn đoán điều này? (Tôi là một người mới thực sự trên UNIX lệnh/đường dẫn/giao thức!) –