임 sudo pip install lxml
와 VIRTUALENV 내 LXML를 설치하려고도 sudo pip install --upgrade lxml
을하지만 두 경우 모두 다음 점점 python2.7에 LXML를 설치할 수 없습니다 : 나는 모든 게시 된 솔루션 here을 시도는
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,
relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
-D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt
-lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools,
tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --record /tmp/pip-nmFOYf-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in
/tmp/pip_build_root/lxml
Storing debug log for failure in /root/.pip/pip.log
을하는 libxml2-dev
, libxslt-dev
및 python-dev
이 설치되어 있고 또한 설치되었음을 의미합니다. build-essential
현재 패키지 관리자로 apt-get
을 사용하는 Linux Mint 17 Debian Based를 실행하고 있습니다.
python-lxml
이미 사전 설치되었습니다.
을 당신이 VIRTUALENV 내에서'sudo'를 사용하는 이유는 무엇입니까? root로 virtualenv를 만들었습니까? 그렇다면 왜? 아니면 virtualenv 내부에 있더라도 시스템 사이트 패키지에 설치하려고합니까? 그렇다면 왜 virtualenv 밖에서하지 않습니까? – abarnert
@abarnert 글쎄, 내가 sudo없이 처음 만들었다면, 전 세계적으로 lxml 설치를 시도했지만 작동하지 않았다. – helado
sudo를 사용하거나 사용하지 않고 virtualenv와 전역 설치를 무작위로 섞어서 사용하면 망가진 권한으로 깨진 virtualenv로 이어집니다. 그러지 마. – abarnert