"error: command 'x86_64-linux-gnu-gcc' failed with

血红的双手。 提交于 2020-03-15 02:20:24

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
原创 2014年12月30日 23:11:55 26574
在ubuntu14.04版本上安装lxml,老是出错,在一番艰辛的搜索之后 ,终于找出了安装的正确方法,其实也就是没有将依赖包装全:

sudo apt-get install libxml2-dev libxslt1-dev python-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libevent-dev
sudo pip install lxml

中途执行pip install lxml可能遇到识别不正确的情况,需要apt-get update一下方可继续

参考网址:

http://lxml.de/installation.html

http://blog.marchtea.com/archives/104

http://blog.marchtea.com/archives/91

下面是之前的参考,也可能会安装成功

sudo apt-get install python-twisted-web python2.7-dev

安装 pip :

$ wget https://bootstrap.pypa.io/get-pip.py
...

$ sudo python get-pip.py install

使用 pip 安装/升级 lxml(升至 3.3.5) 时出现以下报错:

"error: command 'x86_64-linux-gnu-gcc' failed with exit status 1"

这是因为一些依赖包没有安装,可以使用以下命令更新依赖包:

$sudo apt-get build-dep python-lxml

在更新完依赖包后,再次执行 pip 安装:

$ sudo pip install lxml --upgrade

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!