гm trying to install lxml on в виртуальный machine running ubuntu/trusty64 in в virtualenv however i get this ошибка below and can't get my head around it.
/usr/bin/ld: cannot find -lz
the first украдите this ошибку occurred i looked into installing lz. i installed it using отдало apt-get install mtools which contains lz however the ошибку still occurs therefore бm thinking this could be в symbolic соединение problem maybe в file is supposed to be linked to lz but not sure what file. lz ты существуешь в symlink to uz but i dont know what effect that существуешь and don't want to change that нежените it breaks something else. any идеи to point я in the right direction?
building 'lxml.etree' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -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 /home/vagrant/.virtualenvs/devenv/bin/python -c "import setuptools, tokenize;__file__='/home/vagrant/.virtualenvs/devenv/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-yUqdLy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/.virtualenvs/devenv/include/site/python2.7 failed with error code 1 in /home/vagrant/.virtualenvs/devenv/build/lxml
Storing debug log for failure in /home/vagrant/.pip/pip.log
(devenv)vagrant@vagrant-ubuntu-trusty-64:/vagrant/woowoo/woowoo_webapp$ ls -l /usr/bin/ld
lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
(devenv)$ vim /usr/bin/ld.bfd
(devenv)$ ls -l /usr/bin/ld.bfd
-rwxr-xr-x 1 root root 1050912 Sep 16 16:10 /usr/bin/ld.bfd
(devenv)$ ls -l /usr/bin/ld
lrwxrwxrwx 1 root root 6 Sep 16 16:11 /usr/bin/ld -> ld.bfd
(devenv)$ ls -l /usr/bin/lzlrwxrwxrwx 1 root root 2 Oct 10 2013 /usr/bin/lz -> uz
(devenv)$ ls -l /usr/bin/uz
-rwxr-xr-x 1 root root 2496 Oct 10 2013 /usr/bin/uz
Необходимо установить зависимости от сборки lxml для компиляции его. Попытайтесь делать sudo apt-get build-dep python-lxml
, если Вам включили исходные данные пакета в Ваших способных источниках.
то, Что отсутствует, не эти lz
команда, но файлы для разработчика для zlib библиотеки. Необходимо установить zlib1g-dev
для получения этого.
Попробуйте один из тех трех:
sudo apt-get install zlib1g-dev
sudo apt-get install libz-dev
sudo apt-get install lib32z1-dev
желание будет работать на Вас, ссылаются к “/usr/bin/ld: не может найти-lz” для получения дополнительной информации.