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

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

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


当前回答

尝试安装这些包。

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-pil python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev libssl-dev

sudo easy_install greenlet

sudo easy_install gevent

其他回答

首先你需要找出实际的问题是什么。你看到的是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。

这个问题可能源于任何一个缺失的包,尤其是在更新的版本中。

        creating build/temp.linux-x86_64-cpython-39/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/vipin/.cache/pypoetry/virtualenvs/bbox-drf-QjIedbEI-py3.9/include -I/usr/include/python3.9 -c src/base64.c -o build/temp.linux-x86_64-cpython-39/src/base64.o
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/vipin/.cache/pypoetry/virtualenvs/bbox-drf-QjIedbEI-py3.9/include -I/usr/include/python3.9 -c src/kerberos.c -o build/temp.linux-x86_64-cpython-39/src/kerberos.o
    In file included from src/kerberos.c:20:
    src/kerberosbasic.h:17:10: fatal error: gssapi/gssapi.h: No such file or directory
       17 | #include <gssapi/gssapi.h>
          |          ^~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
    [end of output]

大多数人都用最后一行搜索。

错误:command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1

但如果你仔细看,上面的几行,你可以看到哪个包丢失了。它清楚地指出一个目录或文件丢失了

gssapi/gssapi.h:没有这样的文件或目录

搜索为什么这个包可能是你正在寻找的解决方案。

今天用pip升级了我的电脑,并检查了这里的其他答案,我可以告诉你它可能是任何东西。您应该逐一检查错误,查找您需要的特定库。在我的例子中,这些是我必须安装的库:

$ sudo apt-get install libssl-dev
$ sudo apt-get install libffi-dev
$ sudo apt-get install libjpeg-dev
$ sudo apt-get install libvirt-dev
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install libcurl4-openssl-dev
$ sudo apt-get install libxml2-dev libxslt1-dev python-dev

HTH

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

sudo easy_install greenlet

sudo easy_install gevent

下面的答案对我有用,你可以试试:

sudo apt-get install python3-lxml