linux pip mysql-python,pip install MySQL-python在ubuntu 14.04上失败,错误:命令’x86_64-linux-gnu-gcc’失败,退出状态为1...

我已经阅读了要安装的软件包列表的所有堆栈溢出/ google建议,但似乎都没有一个可以解决此问题.

将ubuntu 14.04网络服务器从美国托管服务提供商迁移到欧洲的DigitalOcean,两者都配置了相同的Ansible剧本,但在美国的实例上必须预先安装了某些东西,因为MySQL-python == 1.2.5可以在那里很好地安装.

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

pip install MySQL-python

当我第一次移动到14.04时,由于需要存在libssl-dev,因此在安装MySQL-python时遇到了问题.这似乎是另外一回事.

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

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

#error 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 MUST be included first!

#error 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

解决方法:

带有最新的python-MySQL(1.2.5)的Ubuntu 14.04 libmariadbclient-dev似乎已完全损坏.我连接到MariaDB维护的存储库,并提取了最新版本以克服此编译错误.

标签:python,mysql,compiler-errors,ubuntu-14-04,mysql-python

来源: https://codeday.me/bug/20191013/1906368.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值