当我尝试安装doo-server时,我得到了以下错误:

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

有人能帮我解决这个问题吗?


当前回答

对于Python 3.4使用:

sudo apt-get install python3.4-dev

对于Python 3.5,请使用:

sudo apt-get install python3.5-dev

对于Python 3.6使用:

sudo apt-get install python3.6-dev

对于Python 3.7,请使用:

sudo apt-get install python3.7-dev

对于Python 3.8使用:

sudo apt-get install python3.8-dev

... 等等……

其他回答

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

很多时候,我在安装M2Crypto和pygraphviz时得到了相同的错误,并安装了批准的答案中提到的所有东西。但下面这行解决了我所有的问题与其他包在批准的答案太。

sudo apt-get install libssl-dev swig
sudo apt-get install -y graphviz-dev

这个swig包作为M2Crypto和graphviz-dev的解决方案拯救了我的生命。我希望这能帮助到一些人。

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

执行sudo apt-get install python-dev解决了这个错误。

尽管这是一个老问题,我还是要补充一下我的观点。

我认为正确的答案取决于gcc编译器的错误消息,比如“Missing xxxx.h”

这在某些情况下可能会有所帮助:

sudo apt-get install build-essential python-dev

就像罗宾·温斯洛在评论中说的:

我在这里找到了解决方案:stackoverflow.com/a/5178444/613540

在我的例子中,我的完整错误信息是:

/usr/bin/ld: cannot find -lz 
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我试图安装洪流:

sudo python3 setup.py install

与给定的stackoverflow链接,我解决这个问题:

sudo apt install zlib1g-dev

注意,以下软件包已经安装:

libxslt1-dev is already the newest version.
python3-dev is already the newest version.
libxml2-dev is already the newest version.

希望对大家有所帮助!

在我的例子中,是缺少libffi-dev包。

工作:

sudo apt-get install libffi-dev