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

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

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


当前回答

在Linux Mint中使用python3

$ sudo apt install build-essential python3-dev

应该足够了

其他回答

当我在Ubuntu 14.04上遇到同样的问题时,上面的答案都对我不起作用

然而,这解决了错误:

Sudo apt-get install python-numpy libicu-dev

对于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

... 等等……

首先你需要找出实际的问题是什么。你看到的是C编译器失败了,但你还不知道为什么。向上滚动到得到原始错误的地方。在我的情况下,尝试使用pip3安装一些包,我发现:

    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-4u59c_8b/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-itjeh3va-record/install-record.txt --single-version-externally-managed --compile --user:
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory

 #include <ffi.h>

                 ^

compilation terminated.

所以在我的情况下,我需要安装libffi-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的解决方案拯救了我的生命。我希望这能帮助到一些人。

这对我来说已经足够了:

sudo apt-get install build-essential