{"id":1,"date":"2020-08-17T12:56:15","date_gmt":"2020-08-17T12:56:15","guid":{"rendered":"https:\/\/blog.idez.biz\/?p=1"},"modified":"2020-08-19T13:36:59","modified_gmt":"2020-08-19T13:36:59","slug":"how-to-install-mysqldb-module-on-django","status":"publish","type":"post","link":"https:\/\/idez.biz\/index.php\/how-to-install-mysqldb-module-on-django\/","title":{"rendered":"How to install MySQLdb module on Django"},"content":{"rendered":"\n<p>As many of you would have known, the correct way to install MySQLdb module for use with Django on python 3  is to install <a href=\"https:\/\/pypi.org\/project\/mysqlclient\/\">mysqlclient<\/a> using the command below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install mysqlclient<\/code><\/pre>\n\n\n\n<p>However, there are times after installation, while starting up Django server, the error below still shows, and it was asking whether the mysqlclient module was installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import MySQLdb as Database\nModuleNotFoundError: No module named 'MySQLdb'<\/code><\/pre>\n\n\n\n<p>The mysqlclient module was installed after verifying with &#8220;pip list&#8221;. However, a closer look shows that the version installed was 1.2.5. I am not sure how did that happen. The fix was to force an upgrade of the module:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install mysqlclient --upgrade<\/code><\/pre>\n\n\n\n<p>After that, the error is gone. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>As many of you would have known, the correct way to install MySQLdb module for use with Django on python 3 is to install mysqlclient using the command below: However, there are times after installation, while starting up Django server, the error below still shows, and it was asking whether the mysqlclient module was installed. &#8230; <a title=\"How to install MySQLdb module on Django\" class=\"read-more\" href=\"https:\/\/idez.biz\/index.php\/how-to-install-mysqldb-module-on-django\/\" aria-label=\"Read more about How to install MySQLdb module on Django\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,5,7],"tags":[9,10,8],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-django","category-mysql","category-setup","tag-django","tag-importerror","tag-mysqldb"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcj45d-1","_links":{"self":[{"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":3,"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":71,"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/posts\/1\/revisions\/71"}],"wp:attachment":[{"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idez.biz\/index.php\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}