当我尝试安装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 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

在我的案例中,是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

一切都好!

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

python3:

sudo apt-get install python3-dev \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python3-pip

Python2:

sudo apt-get install python2-dev  \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python2-pip

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

工作:

sudo apt-get install libffi-dev