python安装mysqlclient报错_centos7 安装 python 的 mysql 驱动 mysqlclient,报错,请问如何解决?...

[[email protected] mysqlclient-1.3.7]# python setup.py build

running build

running build_py

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

running build_ext

building '_mysql' extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,3,7,'final',1) -D__version__=1.3.7 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -fstack-protector -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing

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

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

from _mysql.c:40:

/usr/include/python2.7/pyconfig-64.h:1182:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]

#define _POSIX_C_SOURCE 200112L

^

In file included from /usr/include/sys/types.h:25:0,

from /usr/include/mysql/mysql.h:47,

from _mysql.c:30:

/usr/include/features.h:168:0: note: this is the location of the previous definition

# define _POSIX_C_SOURCE 200809L

^

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

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

from _mysql.c:40:

/usr/include/python2.7/pyconfig-64.h:1204:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]

#define _XOPEN_SOURCE 600

^

In file included from /usr/include/sys/types.h:25:0,

from /usr/include/mysql/mysql.h:47,

from _mysql.c:30:

/usr/include/features.h:170:0: note: this is the location of the previous definition

# define _XOPEN_SOURCE 700

^

gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/_mysql.o -L/usr/lib64 -L/usr/lib64 -lmysqlclient -lpthread -lm -lrt -ldl -lpython2.7 -o build/lib.linux-x86_64-2.7/_mysql.so

/usr/bin/ld: cannot find -lmysqlclient

collect2: error: ld returned 1 exit status

error: command 'gcc' failed with exit status 1

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值