Python2.7安装MySQLdb报failed with exit status错误,python2.7mysqldb,python2.7安装M
Python2.7安装MySQLdb报failed with exit status错误,python2.7mysqldb,python2.7安装M
python2.7安装MySQLdb报错
报错信息如下:
running installrunning bdist_eggrunning egg_infowriting MySQL_python.egg-info/PKG-INFOwriting top-level names to MySQL_python.egg-info/top_level.txtwriting dependency_links to MySQL_python.egg-info/dependency_links.txtwriting MySQL_python.egg-info/PKG-INFOwriting top-level names to MySQL_python.egg-info/top_level.txtwriting dependency_links to MySQL_python.egg-info/dependency_links.txtreading manifest file 'MySQL_python.egg-info/SOURCES.txt'reading manifest template 'MANIFEST.in'writing manifest file 'MySQL_python.egg-info/SOURCES.txt'installing library code to build/bdist.linux-i686/eggrunning install_librunning build_pycopying MySQLdb/release.py -> build/lib.linux-i686-2.7/MySQLdbrunning build_extbuilding '_mysql' extensiongcc -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 -o build/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=1In file included from _mysql.c:44:/usr/include/mysql/my_config.h:422:1: warning: "HAVE_WCSCOLL" redefinedIn file included from /usr/local/include/python2.7/Python.h:8, from _mysql.c:29:/usr/local/include/python2.7/pyconfig.h:917:1: warning: this is the location of the previous definitiongcc -pthread -shared build/temp.linux-i686-2.7/_mysql.o -L/usr/lib -lmysqlclient_r -lpthread -lm -lrt -ldl -o build/lib.linux-i686-2.7/_mysql.so/usr/bin/ld: cannot find -lmysqlclient_rcollect2: ld returned 1 exit statuserror: command 'gcc' failed with exit status 1
/usr/bin/ld: cannot find -lmysqlclient_rcollect2: ld returned 1 exit status
链接出错,没找到名叫 mysqlclient_r 的库。你需要安装 mysql-clients(libmariadbclient,或者类似名字)的软件包。如果你告诉我们你正在使用的操作系统/发行版的话,我可能可以给你更具体的处理办法。
1.下载MySQL-python
2.下载setuptools
解压安装
python setup.py buildpython setup.py install
3.返回解压出来的MySQL-python文件夹中
python setup.py buildpython setup.py install
编橙之家文章,
相关内容
- python折算汇率计算的小问题,python折算汇率,碰到了一个
- Python方法要加载1G数据到数组内如何操作,python数组,内
- 基于python2如何将txt内utf-8转换成中文,python2utf-8,在py
- Python默认参数调用疑惑,python参数疑惑,python文档中关于
- Django学习遇到瓶颈要如何继续学习,django瓶颈,RT,目前
- python class中的self _init_(self,param1,param2)怎么回事?,p
- Python switch case实现操作是怎样的,pythonswitch,Python里怎么
- Python模拟登录cookie有验证码要怎么做才能抓到内容,
- python html兼容空格问题,pythonhtml兼容空格,文本框里输入
- Python django监测用户跳转页面状态求思路,pythondjango,d
评论关闭