pip install MySQL-python在ubuntu 14.04上失败,错误:命令'x86_64-linux-gnu-gcc'失败,退出状态1 [英] pip install MySQL-python fails on ubuntu 14.04, error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

查看:5895
本文介绍了pip install MySQL-python在ubuntu 14.04上失败,错误:命令'x86_64-linux-gnu-gcc'失败,退出状态1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经读取所有的堆栈溢出/谷歌推荐的软件包列表安装,没有人似乎解决这个。

I've read all the stack overflow / google recommendations of package lists to install and none of them seem to resolved this.

将ubuntu 14.04网络服务器从美国托管提供商迁移到欧洲的DigitalOcean,都使用相同的Ansible playbook配置,但必须在实例上预安装某些内容美国作为MySQL-python == 1.2.5安装得很好。

Migrating an ubuntu 14.04 webserver from a US hosting provider to DigitalOcean in Europe, both are configured with the same Ansible playbook but there must be something pre-installed on the instance in the US as MySQL-python==1.2.5 installs fine there.

apt-get build-essential python-dev python-pip libssl-dev libmariadbclient-dev
pip install MySQL-python

当我第一次移动到14.04我有问题安装MySQL-python,因为libssl-dev需要存在。

When I first moved to 14.04 I had issues installing MySQL-python because libssl-dev needs to be present. This appears to be something else.

In file included from _mysql.c:44:0:
    /usr/include/mysql/my_config.h:654:2: error: #error <my_config.h> MUST be included first!
     #error <my_config.h> MUST be included first!
      ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5u4s0f-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb

copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb

creating build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants

running build_ext

building '_mysql' extension

creating build/temp.linux-x86_64-2.7

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing

In file included from _mysql.c:44:0:

/usr/include/mysql/my_config.h:439:0: warning: "HAVE_WCSCOLL" redefined [enabled by default]

 #define HAVE_WCSCOLL

 ^

In file included from /usr/include/python2.7/pyconfig.h:3:0,

                 from /usr/include/python2.7/Python.h:8,

                 from _mysql.c:29:

/usr/include/x86_64-linux-gnu/python2.7/pyconfig.h:911:0: note: this is the location of the previous definition

 #define HAVE_WCSCOLL 1

 ^

In file included from _mysql.c:44:0:

/usr/include/mysql/my_config.h:654:2: error: #error <my_config.h> MUST be included first!

 #error <my_config.h> MUST be included first!

  ^

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

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5u4s0f-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/MySQL-python
Storing debug log for failure in /root/.pip/pip.log


推荐答案

Ubuntu 14.04 libmariadbclient-dev与最新的python- MySQL(1.2.5)似乎完全打破。我连接到MariaDB维护repos和拉最新版本,以克服这个编译错误。

The Ubuntu 14.04 libmariadbclient-dev with the latest python-MySQL (1.2.5) seems to be completely broken. I connected to the MariaDB maintained repos and pulled the latest version to get past this compile error.

这篇关于pip install MySQL-python在ubuntu 14.04上失败,错误:命令'x86_64-linux-gnu-gcc'失败,退出状态1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆