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

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

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


当前回答

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

sudo apt-get install libssl-dev

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

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

其他回答

我的堆栈是这样的:

> >                            ^
> >     In file included from /usr/include/openssl/ssl.h:156:0,
> >                      from OpenSSL/crypto/x509.h:17,
> >                      from OpenSSL/crypto/crypto.h:17,
> >                      from OpenSSL/crypto/crl.c:3:
> >     /usr/include/openssl/x509.h:751:15: note: previous declaration of ‘X509_REVOKED_dup’ was here
> >      X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
> >                    ^
> >     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
> >     
> >     ----------------------------------------   Rolling back uninstall of > pyOpenSSL Command "/home/marta/env/pb/bin/python -u -c
> "import setuptools,
> > tokenize;__file__='/tmp/pip-build-14ekWY/pyOpenSSL/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',
> > '\n');f.close();exec(compile(code, __file__, 'exec'))" install
> > --record /tmp/pip-2HERvW-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/marta/env/pb/include/site/python2.7/pyOpenSSL" failed with error
> > code 1 in /tmp/pip-build-14ekWY/pyOpenSSL/

在同样的情况下,请考虑其中一个安装文件中的错字(错误),并手动编辑它,将“X509_REVOKED_dup”更改为“X509_REVOKED_dupe”(没有引号)。我已经编辑了x509.h文件:

sed -e的 usr / include / openssl - x509。h

这对我来说很有效,但请参考下面链接的帖子,因为他们编辑了另一个文件:

sed -e's/X509_REVOKED_dup/X509_REVOKED_dupe/g' -i OpenSSL/crypto/crl.c . sed -e's/X509_REVOKED_dup/X509_REVOKED_dupe/g

https://groups.google.com/forum/ !主题/ kivy-users / Qt0jNIOACZc

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

sudo apt-get install libssl-dev

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

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

在我的情况下,pip无法安装库,我尝试了上面给出的解决方案,但没有一个有效,但下面的方法对我有效:

sudo apt upgrade gcc

提示:请不要认为这是一个答案。也只是为了帮助别人。

我在安装psycopg2时遇到了类似的问题。我安装了build-essential, python-dev和libpq-dev,但它抛出了同样的错误。

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

因为我在部署时很匆忙,所以最后只是复制了整行 @user3440631的回答。

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

而且效果很好。但是找不到哪个包解决了我的问题。 如果有人从上面的命令中了解psycopg2依赖包,请更新评论。

在我的情况下,听从命令是有魔力的

sudo apt-get install gcc python3-dev

如果上面的命令不起作用,请尝试以下两个命令

sudo apt-get install gcc python-dev

当您希望它在您的机器中为默认python版本安装时,就会出现这种情况。

Or

sudo apt-get install gcc python3.x-dev

python3的地方。X表示安装在您机器上的python的版本号。