尝试安装lxml时,命令'gcc'以退出状态1失败

时间:2014-11-28 06:37:30

标签: python gcc lxml

我是python中的新手,我尝试使用openpyxl来处理excel。当我使用sudo pip install lxml时,我遇到了这种错误的信息:

In file included from src/lxml/lxml.etree.c:239:0:

/tmp/pip_build_root/lxml/src/lxml/includes/etree_defs.h:14:31: fatal error: libxml/xmlversion.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------
Rolling back uninstall of lxml

感谢您的帮助

1 个答案:

答案 0 :(得分:3)

您需要安装其他软件包,有关详细信息,请参阅here

sudo apt-get install libxml2-dev libxslt-dev python-dev
相关问题