“ModuleNotFoundError: No module named 'MySQLdb'” Code Answer’s

Sometimes while performing MySQL operation you may get an error like that:

ModuleNotFoundError: No module named 'MySQLdb

It is due to the absence of a module in the system to link with the MySQL database. There are several ways to solve that problem like:

  1. Install the MySQL-Python module, its script does not cause any problem.
  2. Another way is to install a python module using pip.
  3. Install the pymysql package.

No module named 'MySQLdb'

on Jan 01, 1970
sudo apt-get install -y python3-mysqldb

Add Comment

0

import MySQLdb as Database ModuleNotFoundError: No module named 'MySQLdb'

on Jan 01, 1970
sudo apt-get install -y python-dev libmysqlclient-dev && sudo pip install mysqlclient

Add Comment

0

ModuleNotFoundError: No module named 'MySQLdb' in windows

on Jan 01, 1970
You can install mysqlclient with pip

If using Python3, try this:

pip3 install mysqlclient

or in Python2

pip install mysqlclient

Add Comment

0

ModuleNotFoundError: No module named 'MySQLdb'

on Jan 01, 1970
sudo apt-get install libmysqlclient-dev
sudo apt-get install libssl-dev
pip install mysqlclient

Add Comment

0

modulenotfounderror no module named 'mysqldb' anaconda

on Jan 01, 1970
conda install -c anaconda mysqlclient

Add Comment

0

Hope you have gotten your answer. If facing any problem related to the "No module named 'MySQLdb" error, you may ask in the comment box.


Thank you for visiting this page.

Python answers related to "No module named 'mysqldb'"

View All Python queries

Python queries related to "No module named 'mysqldb'"

Browse Other Code Languages

CodeProZone