我正在尝试在 virtualenv 中运行 ubuntu/trusty64 的虚拟机上安装 lxml,但是我在下面收到此错误并且无法理解它。
/usr/bin/ld: cannot find -lz
Run Code Online (Sandbox Code Playgroud)
第一次发生此错误时,我考虑安装 lz。我使用包含 lz 的 sudo apt-get install mtools 安装它,但是错误仍然发生,因此我认为这可能是符号链接问题,也许文件应该链接到 lz 但不确定是什么文件。lz 有一个指向 uz 的符号链接,但我不知道它有什么影响,也不想改变它,以防它破坏其他东西。有什么想法可以指出我正确的方向吗?
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: …
Run Code Online (Sandbox Code Playgroud) virtualbox ×1