Error No module named MySQLdb

0 votes
I am using Python version 3.8.3 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL.

How to fix this error?
Jun 26, 2020 in Python by kartik
• 37,520 points
15,356 views

1 answer to this question.

0 votes

Hii @kartik,

Try this code:

pip install PyMySQL

and then add this two lines to your Project/Project/init.py

import pymysql
pymysql.install_as_MySQLdb()

Hope it works!!
Thank You!

answered Jun 26, 2020 by Niroj
• 82,840 points
Thank you so much!! Your answer was really helpful.

Related Questions In Python

0 votes
1 answer

Python error "ImportError: No module named pygame.locals"

You need to download and install the ...READ MORE

answered Jun 18, 2019 in Python by Greg
7,036 views
0 votes
2 answers

Python error " import requests ImportError: No module named requests"

Hello, Open Cmd or Powershell as Admin. type pip ...READ MORE

answered Nov 28, 2020 in Python by Rohan
• 200 points
17,482 views
0 votes
1 answer
0 votes
2 answers

Python error "ImportError: No module named 'tkinter'"

sudo apt-get install python3-tk Then, >> import tkinter # ...READ MORE

answered Nov 9, 2019 in Python by Icetutor
• 160 points
24,725 views
0 votes
1 answer

How to run Django's test database only in memory?

Hello @kartik, If you set your database engine ...READ MORE

answered Jun 24, 2020 in Python by Niroj
• 82,840 points
4,343 views
0 votes
1 answer

How to Specify a mySQL ENUM in a Django model?

Hello @kartik, You can follow this snippet below: MAYBECHOICE ...READ MORE

answered Jun 24, 2020 in Python by Niroj
• 82,840 points
1,489 views
0 votes
1 answer

ERROR: mysql 1018 (HY000): Can't read dir of '.' (errno: 13)

Hello @kartik, You need to set ownership and ...READ MORE

answered Jun 24, 2020 in Python by Niroj
• 82,840 points
2,585 views
0 votes
1 answer

Error: No module named 'django.core.urlresolvers'

Hello @kartik, If you want to import reverse, ...READ MORE

answered Aug 5, 2020 in Python by Niroj
• 82,840 points
9,768 views
0 votes
1 answer
0 votes
1 answer

Import Error: No module named numpy?

Hello, I had numpy installed on the same ...READ MORE

answered Apr 14, 2020 in Python by Niroj
• 82,840 points
12,884 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP