Sto costruendo lxml su Mac OS X 10.8.1 e Python 2.7.2 e ho problemi. (Ho clonato il repository Github e ho seguito le istruzioni per Mac OS X qui: http://lxml.de/build.html)Cosa sto facendo male quando si installa lxml su Mac OS X 10.8.1?
Sembra che qualcosa si blocchi nella costruzione di libxml2; la seguente è la coda del terminale di uscita:
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
I' m WAY fuori dalla mia profondità nel tentativo di capire cosa c'è di sbagliato qui. Qualcuno può indicarmi la direzione di ciò che devo fare per risolvere il problema?
Wow, grazie mille per la risposta incredibilmente completa! So che ho provato a usare pip in un primo momento ma non ha funzionato; L'ho appena provato e completato con successo. (Terminale output alla fine = "Lxml installato con successo") Ma quando vado in python e digito "import lxml" ottengo "ImportError: No module named lxml". Qualche idea su cosa sto facendo male? –
Avete qualche installazione non Apple Python? È possibile che tu stia utilizzando versioni di pip e python che non corrispondono. Una cosa abbastanza comune è che si finisce con/usr/local/bin/pip (o/opt/local/bin/pip, ecc.) Come primo pip sul proprio percorso e installa moduli per/usr/local/bin/python, ma poi/usr/bin/python come primo python. – abarnert
È possibile che sia riuscito a rovinare tutto a un certo punto. Come posso diagnosticare questo? (Sono un vero novizio su comandi/percorsi/protocolli UNIX!) –