{"id":929,"date":"2015-07-13T15:49:00","date_gmt":"2015-07-13T15:49:00","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2015\/07\/13\/python-no-module-named-mysqldb\/"},"modified":"2021-07-24T15:37:59","modified_gmt":"2021-07-24T15:37:59","slug":"python-no-module-named-mysqldb","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Python\/python-no-module-named-mysqldb.html","title":{"rendered":"Python – No module named MySQLdb"},"content":{"rendered":"
When trying to import MySQLdb you may find that the module is not available. And experience an error such as,<\/p>\n
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
No module named MySQLdb<\/span><\/pre>\nSolution<\/h2>\n
The solution is to install MySQL-python<\/span> i.e<\/p>\n
pip<\/span>-<\/span>2.7<\/span> install <\/span>MySQL<\/span>-<\/span>python<\/span><\/pre>\n
PIP INSTALL Error<\/h3>\n
However, when trying to install MySQL-python<\/span> you may then get the following error,<\/p>\n
pip<\/span>-<\/span>2.7<\/span> install <\/span>MySQL<\/span>-<\/span>python <\/span>...<\/span> error<\/span>:<\/span>Setup<\/span> script exited <\/span>with<\/span> error<\/span>:<\/span> command <\/span>'gcc'<\/span> failed <\/span>with <\/span>exit<\/span> status <\/span>1<\/span><\/span><\/pre>\n
To fix this issue install the following,<\/p>\n
yum install mysql<\/span>-<\/span>devel<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"
Issue When trying to import MySQLdb you may find that the module is not available. And experience an error such as, django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb Solution The solution is to install MySQL-python i.e pip-2.7 install MySQL-python PIP INSTALL Error However, when trying to install MySQL-python you may then get the following … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"yoast_head":"\n
Python - No module named MySQLdb - Fir3net<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n