当我尝试安装doo-server时,我得到了以下错误:
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
有人能帮我解决这个问题吗?
当我尝试安装doo-server时,我得到了以下错误:
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
有人能帮我解决这个问题吗?
当前回答
除了一些其他有用的答案,如果docker-compose把你带到这里——使用你的venv集,运行:
easy_install docker-compose
其他回答
提示:请不要认为这是一个答案。也只是为了帮助别人。
我在安装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依赖包,请更新评论。
在我的例子中,是缺少libffi-dev包。
工作:
sudo apt-get install libffi-dev
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
很多时候,我在安装M2Crypto和pygraphviz时得到了相同的错误,并安装了批准的答案中提到的所有东西。但下面这行解决了我所有的问题与其他包在批准的答案太。
sudo apt-get install libssl-dev swig
sudo apt-get install -y graphviz-dev
这个swig包作为M2Crypto和graphviz-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:没有这样的文件或目录
搜索为什么这个包可能是你正在寻找的解决方案。
就像罗宾·温斯洛在评论中说的:
我在这里找到了解决方案:stackoverflow.com/a/5178444/613540
在我的例子中,我的完整错误信息是:
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
我试图安装洪流:
sudo python3 setup.py install
与给定的stackoverflow链接,我解决这个问题:
sudo apt install zlib1g-dev
注意,以下软件包已经安装:
libxslt1-dev is already the newest version.
python3-dev is already the newest version.
libxml2-dev is already the newest version.
希望对大家有所帮助!