3

when I activate virtualenv and type 'pip install lxml' installation process crashes with message:

/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
1
  • There is a some required packages missing problem. Please install this packages to your system.I'm using centos and i have install it using yum command. libxml2 libxml2-devel libxslt libxslt-devel Commented Oct 23, 2019 at 9:43

4 Answers 4

4

The error you have to pay attention to is the first "/usr/bin/ld: cannot find -lz": tnhat means you don't have zlib-dev installed. Depending on your linux distribution it could be named zlib-dev or zlib1g-dev in Ubuntu, I don't know in other distros.

Sign up to request clarification or add additional context in comments.

Comments

0

Installing those dependencies fixed it for me (Debian 7):

sudo apt-get install libxml2-dev libxslt1-dev

source: src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory

Comments

0

From https://askubuntu.com/questions/627140/cannot-install-lxml-on-ubuntu-14

sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip

Comments

0

For RHEL7/Fedora/CentOS in order to install lxml you need to:

YUM/DNF install libxml2 libxslt

...and possibly:

YUM/DNF install libxslt-devel libxml2-devel

Cheers!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.