-lz 编译标志需要安装什么库

-lz 编译标志需要安装什么库

我输入命令后出现以下错误:

pip install -r requirements.txt

错误信息如下:

...
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 -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -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


----------------------------------------
Command "/home/<user_id>/.../<virtualenv_name>/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-SBDLKx/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-OSju9J-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/<user_id>/.../<virtualenv_name>/include/site/python2.7/lxml" failed with error code 1 in /tmp/pip-build-SBDLKx/lxml/

-lz在 Ubuntu 上需要安装哪些缺少的库?

答案1

对于与 链接的库-lfoo,请查找libfoo.so和提供它的包。libz.so由提供 zlib1g-dev

相关内容