Python 安装脚本退出并出现错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26053982/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 23:58:22  来源:igfitidea点击:

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

pythongccpipodoo-server

提问by Madura Dissanayake

When I try to install odoo-server, I got the following error:

当我尝试安装时odoo-server,出现以下错误:

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

Could anyone help me to solve this issue?

谁能帮我解决这个问题?

采纳答案by Madura Dissanayake

Try installing these packages.

尝试安装这些软件包。

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 libssl-dev

sudo easy_install greenlet

sudo easy_install gevent

回答by the-run

$ 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

OR TRY THIS:

或者试试这个:

$ sudo apt-get install libxml2-dev libxslt1-dev

回答by Fred

Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications.

Python.h 只不过是一个头文件。gcc 使用它来构建应用程序。您需要安装一个名为 python-dev 的包。该软件包包括头文件、静态库和用于构建 Python 模块、扩展 Python 解释器或在应用程序中嵌入 Python 的开发工具。

enter:

进入:

$ sudo apt-get install python-dev

or

或者

# apt-get install python-dev

see http://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/

http://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/

回答by user2106495

Despite being an old question, I'll add my opinion.

尽管是一个老问题,但我会补充我的意见。

I think the right answer depends on the error message of the gcc compiler, something like "Missing xxxx.h"

我认为正确的答案取决于 gcc 编译器的错误信息,比如“Missing xxxx.h”

This might help in some cases:

这在某些情况下可能会有所帮助:

sudo apt-get install build-essential python-dev

回答by Paulie

I encountered the same problem in college having installed Linux Mint for the main project of my final year, the third solution below worked for me.

我在大学时遇到了同样的问题,为我最后一年的主要项目安装了 Linux Mint,下面的第三个解决方案对我有用。

When encountering this error please note before the error it may say you are missinga package or header file — you should find those and install them and verify if it works (e.g. ssl → libssl).

遇到此错误时,请在错误之前注意,它可能表示您缺少包或头文件——您应该找到它们并安装它们并验证它是否有效(例如 ssl → libssl)。

For Python 2.xuse:

对于Python 2.x使用:

$ sudo apt-get install python-dev

For Python 2.7use:

对于Python 2.7使用:

$ sudo apt-get install libffi-dev

For Python 3.xuse:

对于Python 3.x使用:

$ sudo apt-get install python3-dev

or for a specific version of Python 3, replace xwith the minor version in

或者对于特定版本的 Python 3,替换x为次要版本

$ sudo apt-get install python3.x-dev

回答by musicakc

None of the above answers worked for me when I had the same issue on my Ubuntu 14.04

当我在 Ubuntu 14.04 上遇到同样的问题时,上述答案都对我不起作用

However, this solved the error:

但是,这解决了错误:

sudo apt-get install python-numpy libicu-dev

sudo apt-get install python-numpy libicu-dev

回答by Kenly

You need to install these packages:

您需要安装这些软件包:

sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev

回答by nikhil komawar

In my case, it was missing package libffi-dev.

就我而言,它缺少包libffi-dev

What worked:

什么工作:

sudo apt-get install libffi-dev

回答by Mario S

After upgrade my computer with pip today, and check the other answers here, I can tell you that it could be ANYTHING. You should check error by error, looking for what's the specific library that you need. In my case, these were the libraries that I had to install:

今天用 pip 升级我的电脑后,在这里查看其他答案,我可以告诉你它可能是任何东西。您应该逐个错误地检查错误,寻找您需要的特定库。就我而言,这些是我必须安装的库:

$ sudo apt-get install libssl-dev
$ sudo apt-get install libffi-dev
$ sudo apt-get install libjpeg-dev
$ sudo apt-get install libvirt-dev
$ sudo apt-get install libsqlite3-dev
$ sudo apt-get install libcurl4-openssl-dev
$ sudo apt-get install libxml2-dev libxslt1-dev python-dev

HTH

HTH

回答by Evyatar Sivan

on ubuntu 14.04:

在 Ubuntu 14.04 上:

sudo apt-file search ffi.h 

returned:

回来:

chipmunk-dev: /usr/include/chipmunk/chipmunk_ffi.h
ghc-doc: /usr/share/doc/ghc-doc/html/users_guide/ffi.html
jython-doc: /usr/share/doc/jython-doc/html/javadoc/org/python/modules/jffi/jffi.html
libffi-dev: /usr/include/x86_64-linux-gnu/ffi.h
libffi-dev: /usr/share/doc/libffi6/html/Using-libffi.html
libgirepository1.0-dev: /usr/include/gobject-introspection-1.0/girffi.h
libgirepository1.0-doc: /usr/share/gtk-doc/html/gi/gi-girffi.html
mlton-basis: /usr/lib/mlton/include/basis-ffi.h
pypy-doc: /usr/share/doc/pypy-doc/html/config/objspace.usemodules._ffi.html
pypy-doc: /usr/share/doc/pypy-doc/html/config/objspace.usemodules._rawffi.html
pypy-doc: /usr/share/doc/pypy-doc/html/rffi.html

I chose to install libffi-dev

我选择安装 libffi-dev

sudo apt-get install libffi-dev

worked perfectly

完美地工作