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

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

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


当前回答

在我的案例中,是oursql导致了如下所示的相同(通用)错误。

In file included from oursqlx/oursql.c:236:0:
  oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for oursql
  Running setup.py clean for oursql

因此,我知道我需要libmysqlcppconn-dev包。

sudo apt-get install libmysqlcppconn-dev

一切都好!

其他回答

尝试安装这些包。

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

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

... 等等……

在Linux Mint中使用python3

$ sudo apt install build-essential python3-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 upgrade gcc