为什么我无法在虚拟环境中使用`pip install lxml`命令?

10 浏览
0 Comments

为什么我无法在虚拟环境中使用`pip install lxml`命令?

提示:我正在使用virtualenvwrapper。

在激活虚拟环境之前:

$ pip install lxml
要求已满足(使用--upgrade进行升级):lxml在/usr/lib/python2.7/dist-packages中
清理中...

在激活虚拟环境之后:

(test-env)$ pip install lxml
force/build/lxml/src/lxml/includes/etree_defs.h:9:31: 致命错误:libxml/xmlversion.h:没有那个文件或目录
编译终止。
错误:命令'gcc'退出状态为1
----------------------------------------
命令/home/chaz/dev/envs/test-with-system-python-force/bin/python2.7 -c "import setuptools;__file__='/home/chaz/dev/envs/test-with-system-python-force/build/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bJ6Q_B-record/install-record.txt --single-version-externally-managed --install-headers /home/chaz/dev/envs/test-env/include/site/python2.7失败,错误代码为1 在/home/chaz/dev/envs/test-env/build/lxml中
完整日志存储在/home/chaz/.pip/pip.log中

0