Home >Database >Mysql Tutorial >Why am I getting a \'Error Loading MySQLdb Module\' in my Django project on Windows 10?
Error Loading MySQLdb Module: 'Did you install mysqlclient or MySQL-python?'
Problem:
Users working in a Windows 10 command line for a Django project using Python 3.4 experience difficulties with SQL despite installing mysqlclient and locating the file. When running python manage.py migrate, they encounter an error stating that the MySQLdb module could not be loaded.
Solution:
To resolve the issue, follow these steps:
Install the pymysql module using pip:
pip install pymysql
Open the __init__.py file and add the following lines:
import pymysql pymysql.install_as_MySQLdb()
By following these steps, the pymysql module is installed and configured to behave as the MySQLdb module. This will allow the Django project to successfully load the MySQLdb module and interact with the SQL database using phpMyAdmin.
The above is the detailed content of Why am I getting a \'Error Loading MySQLdb Module\' in my Django project on Windows 10?. For more information, please follow other related articles on the PHP Chinese website!