Django 500 Internal Server Error - ImproperlyConfigured: Error loading MySQLdb module:

旧时模样 提交于 2019-12-02 06:24:14

This line:

ImproperlyConfigured: Error loading MySQLdb module: this is MySQLdb version (1, 2, 5, 'final', 1), but _mysql is version (1, 2, 3, 'final', 0) 

indicates you might have a version mismatch between MysqlDB and MySQL. Sounds like looking in to it and reinstalling your dependent libraries resolved the issue.

To describe the issue in further detail:

In this case apt-get was installing MySQL-python==1.2.3. The latest version is MySQL-python==1.2.5. However apt-get was not finding it, so completely removing MySQL-python==1.2.3 using:

sudo apt-get remove --purge python-mysqldb

and then reinstall via pip

sudo pip install mysql-python

(Note the package names are slightly different)

In the interest of helping others who may come to this post with the same error:

I was receiving the same error, but my MySQL-python version was the same as the expected: 1.2.5. The problem was that I had the MySQLdb folder symlinked into my project's root folder. By moving the symlinked folder into the folder that holds my Django settings I was able to fix the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!