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

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

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


当前回答

对我来说,它有助于安装libxml2-dev和libxslt1-dev。

sudo apt-get install libxml2-dev

其他回答

对我来说,以上这些都没用。但是,我解决了安装libssl-dev的问题。

sudo apt-get install libssl-dev

这可能会工作,如果你有相同的错误信息在我的情况下:

致命错误:openssl/openssl .h:没有这样的文件或目录... .... 命令“x86_64-linux-gnu-gcc”退出状态为1失败

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

        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:没有这样的文件或目录

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

$ sudo apt-get install gcc
$ sudo apt-get install python-dateutil python-docutils python-feedparser python-gdata python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi

或者试试这个:

$ sudo apt-get install libxml2-dev libxslt1-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。

对于Centos 7使用以下命令安装Python开发包

Python 2.7

Sudo yum安装python-dev

Python 3.4

Sudo yum安装python34-devel

如果您的问题仍然没有解决,然后尝试安装以下包-

Sudo yum安装libffe -devel 安装openssl-devel