python2.7安装MySQLdb报错

python2.7安装MySQLdb报错
报错信息如下:
runninginstall
runningbdist_egg
runningegg_info
writingMySQL_python.egg-info/PKG-INFO
writingtop-levelnamestoMySQL_python.egg-info/top_level.txt
writingdependency_linkstoMySQL_python.egg-info/dependency_links.txt
writingMySQL_python.egg-info/PKG-INFO
writingtop-levelnamestoMySQL_python.egg-info/top_level.txt
writingdependency_linkstoMySQL_python.egg-info/dependency_links.txt
readingmanifestfile'MySQL_python.egg-info/SOURCES.txt'
readingmanifesttemplate'MANIFEST.in'
writingmanifestfile'MySQL_python.egg-info/SOURCES.txt'
installinglibrarycodetobuild/bdist.linux-i686/egg
runninginstall_lib
runningbuild_py
copyingMySQLdb/release.py->build/lib.linux-i686-2.7/MySQLdb
runningbuild_ext
building'_mysql'extension
gcc-pthread-fno-strict-aliasing-g-O2-DNDEBUG-g-fwrapv-O3-Wall-Wstrict-prototypes-fPIC-Dversion_info=(1,2,4,'beta',4)-D__version__=1.2.4b4-I/usr/include/mysql-I/usr/local/include/python2.7-c_mysql.c-obuild/temp.linux-i686-2.7/_mysql.o-g-pipe-Wp,-D_FORTIFY_SOURCE=2-fexceptions-fstack-protector--param=ssp-buffer-size=4-m32-fasynchronous-unwind-tables-fPIC-g-static-libgcc-fno-omit-frame-pointer-fno-strict-aliasing-DMY_PTHREAD_FASTMUTEX=1
Infileincludedfrom_mysql.c:44:
/usr/include/mysql/my_config.h:422:1:warning:"HAVE_WCSCOLL"redefined
Infileincludedfrom/usr/local/include/python2.7/Python.h:8,
from_mysql.c:29:
/usr/local/include/python2.7/pyconfig.h:917:1:warning:thisisthelocationofthepreviousdefinition
gcc-pthread-sharedbuild/temp.linux-i686-2.7/_mysql.o-L/usr/lib-lmysqlclient_r-lpthread-lm-lrt-ldl-obuild/lib.linux-i686-2.7/_mysql.so
/usr/bin/ld:cannotfind-lmysqlclient_r
collect2:ldreturned1exitstatus
error:command'gcc'failedwithexitstatus1
子衿沉夜
浏览 374回答 2
2回答

达令说

/usr/bin/ld:cannotfind-lmysqlclient_rcollect2:ldreturned1exitstatus链接出错,没找到名叫mysqlclient_r的库。你需要安装mysql-clients(libmariadbclient,或者类似名字)的软件包。如果你告诉我们你正在使用的操作系统/发行版的话,我可能可以给你更具体的处理办法。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript