Open metroluffy opened 6 years ago
在新的Centos下安装MySQL-python,如果直接一把梭yum install MySQL-python,可能会遇见错误。因此在此之前你需要先安装Gcc、python-devel、 mysql-devel
yum install MySQL-python
# Install Gcc yum install gcc # Install Python devel packages yum install python-devel # Install MySQL devel packages yum install mysql-devel
一些错误
import MySQLdb
ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory
>>> find / -name libmysqlclient.so.18 >>> ln -s /path/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18 >>> ldconfig # 立即生效
类似的错误解决方法差不多
在新的Centos下安装MySQL-python,如果直接一把梭
yum install MySQL-python
,可能会遇见错误。因此在此之前你需要先安装Gcc、python-devel、 mysql-devel一些错误
import MySQLdb
时报:ImportError: libmysqlclient.so.18: cannot open shared object file: No such file or directory
类似的错误解决方法差不多
参考资料