필자는 내 서버에 Centos 6을 가지고 있으며, 몇 가지 패키지 (모듈)를 설치하려고 시도 해왔다. 난 그냥 /usr/lib/python2.6/site-packages
에서 FTP 클라이언트 내 창문에 사람을 가져왔다,하지만 난 내 스크립트 중 하나를 실행할 때 - lxml이 나에게 오류 제공 :CentOS 6.3의 Python lxml etree
File "plugins/util/http.py", line 12, in <module>
from lxml import etree, html
File "/usr/lib/python2.6/site-packages/lxml/html/__init__.py", line 12, in <module>
ImportError: cannot import name etree
7 & 리눅스 우분투 10.04를 .
왜이 오류를 반환하는지 누가 알 수 있습니까? 나는 아무것도 수정하지 않고, 윈도우에서 모듈을 내 vps의 python2.6 디렉토리로 옮겼다.
@root :
>>> import lxml;print lxml
<module 'lxml' from '/usr/lib/python2.6/site-packages/lxml/__init__.pyc'>
>>>
@ig
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/libxml2 -I/tmp/pip-build/lxml/src/lxml/includes -I/usr/include/python2.6 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.6/src/lxml/lxml.etree.o
GCC를 실행하지 못할 :
오류 해당 파일이나 디렉토리 : 명령 'GCC'종료 상태로 실패를 1
'수입 LXML을 무엇; print lxml' print? – root
@root, 내 첫 번째 게시물을 편집했습니다. – RewriteRule
인터프리터에서 etree를 가져올 때 동일한 오류가 발생합니까? 또는 interpeter에서 사용한 것과 같은 행을 스크립트 시작 부분에 추가하면 동일한 결과가 인쇄됩니까? – root