python error command x86_64-linux-gnu-gcc failed with exit status 1

今天在试用一个python应用-glances,挺好用的,可惜在我服务器上安装:

pip install glances

运行出现了这个问题:

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

恼人。参考GitHub issues给出的办法,解决办法如下:

python3 运行:

sudo apt-get install python3 python-dev python3-dev \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python-pip

python2 运行:

sudo apt-get install python-dev  \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python-pip

参考资料


linux 网络学习备忘 10位 30+ 岁程序员的故事和人生