mysql-python 安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql-python 安装相关的知识,希望对你有一定的参考价值。
[[email protected] ~]# [[email protected]st ~]# [[email protected] ~]# gcc -v 查看是否安装gcc 若报错则未安装
[[email protected] ~]# yum -y install gcc 安装gcc
[[email protected] ~]# wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.4b4/MySQL-python-1.2.4b4.tar.gz?use_mirror=ncu 下载软件包
[[email protected] ~]# tar zxvf MySQL-python-1.2.4b4.tar.gz cd MySQL-python-1.2.4b4 解压软件包
解压包复制到 /usr/local/src/ 下
进入 /usr/local/src/MySQL-python-1.2.4b4
# embedded: link against the embedded server library # threadsafe: use the threadsafe client # static: link against a static library (probably required for embedded)
embedded = False
threadsafe = False (改为False)
static = False
# The path to mysql_config. # Only use this if mysql_config is not on your PATH, or you have some weird # setup that requires it.
mysql_config = /usr/local/mysql/bin/mysql_config (前面的#去掉,并把路径更改正确)
最后进行安装:
# python setup.py install
File "<stdin>", line 1, in <module>
File "MySQLdb/__init__.py", line 19, in <module>
import _mysql
ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory
以上是关于mysql-python 安装的主要内容,如果未能解决你的问题,请参考以下文章