Error loading MySQLdb module:no module named MySQLdb wrong solution

Source: Internet
Author: User
Tags install pandas

The specific error is as follows:

Django.core.exceptions.ImproperlyConfigured:Error loading mysqldb module:no module named MySQLdb


Solution Method:

Need to install Python-connected MySQL module

Note: I use yum install Mysql-pyton after installation still reported error, tested must be PIP mode installation

Pip Install Mysql-python


If the installation reported the following error:

Pip install Pandas ' gives Unicodedecodeerror: ' ASCII ' codec can ' t decode byte 0xe2 in position 41:ordinal not in range (12 8)


You need to upgrade the PIP version:

Pip Install--upgrade pip


Reinstall the installation Mysql-python after the upgrade is complete

Pip Install Mysql-python


If the installation reported the following error:

_mysql.c:2091:error: ' R ' Undeclared (first use of this function)

_mysql.c:2091:error: ' _mysql_resultobject ' has no member named ' Result '

_mysql.c:2092:error: ' _mysql_resultobject ' has no member named ' Result '

_mysql.c:in function ' _mysql_resultobject_dealloc ':

_mysql.c:2100:warning:implicit declaration of function ' Mysql_free_result '

_mysql.c:2100:error: ' _mysql_resultobject ' has no member named ' Result '

_mysql.c:at Top level:

_mysql.c:2331:error: ' _mysql_connectionobject ' has no member named ' Open '

_mysql.c:2338:error: ' _mysql_connectionobject ' has no member named ' Converter '

_mysql.c:2345:error: ' _mysql_connectionobject ' has no member named ' Connection '

_mysql.c:2352:error: ' _mysql_connectionobject ' has no member named ' Connection '

_mysql.c:2359:error: ' _mysql_connectionobject ' has no member named ' Connection '

_mysql.c:2422:error: ' _mysql_resultobject ' has no member named ' Converter '

_mysql.c:2422:error:initializer element is not constant

_mysql.c:2422:error: (Near initialization for ' _mysql_resultobject_memberlist[0].offset ')

_mysql.c:in function ' _mysql_connectionobject_getattr ':

_mysql.c:2444:error: ' _mysql_connectionobject ' has no member named ' Open '

Error:command ' gcc ' failed with exit status 1


Workaround: Yum-y install mysql-devel libxml2 libxml2-dev libxslt* zlib gcc OpenSSL


Try installing Mysql-python again after installation is complete

Pip Install Mysql-python

[[Email protected] craxsxx]# pip install Mysql-python

Collecting Mysql-python

Using Cached Mysql-python-1.2.5.zip

Installing collected Packages:mysql-python

Running setup.py Install for Mysql-python

Successfully installed mysql-python-1.2.5


Mysql-python Module Installation is successful


This article is from the "Small Five Car God" blog, please be sure to keep this source http://linuxtech.blog.51cto.com/3670088/1732301

Error loading MySQLdb module:no module named MySQLdb wrong solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.