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

Source: Internet
Author: User

The following error was reported today when Django created the MySQL database table:

Raise improperlyconfigured("Error loading MySQLdb module:%s" %e)Django.Core.Exceptions.improperlyconfigured: error loading < Span style= "font-family: ' Microsoft Yahei ';" >mysqldb module : no module named mysqldb
in my Baidu query, finally found the problem is that there is no installation of Mysql-python. Based on this problem, various solutions are available on the web, most of which are based on Python packages

Install and manage the tools pip command to install Mysql-python(perform pip install Mysql-python installation under cmd command line), However, the following errors were reported during the installation process:

Command "D:\python27\python.exe-u-C" Import setuptools, tokenize;__file__= ' c:\\users\\tangbo\\appdata\\local\\temp \\pip-build-wif0di\\mysql-python\\setup.py '; Exec (Compile (getattr (tokenize, ' open ', open) (__file__). Read (). Replace (' \ r \ n ', ' \ n '), __file__, ' exec ') "Install--record c:\users\tangbo\appdata\local\temp\pip-yvc9jx-record\ Install-record.txt--single-version-externally-managed--compile "failed with error code 1 in c:\users\tangbo\appdata\ local\temp\pip-build-wif0di\mysql-python\

I found a simpler way to solve this problem:

1, download mysql-python installation package, the address is as follows:

https://pypi.python.org/pypi/MySQL-python/1.2.5

Open the Web page, navigate to the location as shown, download the arrow refers to the installation package (my machine is 64-bit, download this 32-bit also no problem):

2. Click Install Package Installation

Click to set the path as follows:

Where Python Directory: Set the path to Python installation

Installation directory: Set to the Python installation path under the \lib\site-pack-ages\ directory

Complete the above steps andMysql-python installation is completed .

The program that Django creates MySQL database tables runs smoothly. The results of proper operation under Eclipse are as follows:

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

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.