Wasim
Wasim

Reputation: 1935

MySQLdb problem with Django and PyDev

I built my project with Django in Pydev. Every thing is working well. Now I configured PyDev to debug the project by adding runserver 8001--noreload When I sent the Database engin to sqlite3 every thing is ok and I can debug the project. When I put the database engin to MySQL (my real DB) and try to debug, I get : django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: DLL load failed: The specified module could not be found.

Please any help to resolve this problem. I installed the MySQLdb driver to my windows. When I run the project normally it works, only I get this problem with Debuging.

Thanks

Upvotes: 0

Views: 1446

Answers (2)

Danilo
Danilo

Reputation: 83

In the Debug Configurations window, go to the Environment tab and add the following environment variable:

variable: DYLD_LIBRARY_PATH value: /usr/local/mysql/lib

And that's it.

Upvotes: 1

slowkvant
slowkvant

Reputation: 309

I noticed in Window -> Preferencs -> Pydev - Interpreter -> Libraries that... it said: C:\Python26\lib\site-packages when it actually says: C:\Python26\Lib\site-packages Lib instead of lib! Then it worked perfectly :) Finally MySQLdb has code completion.

Upvotes: 0

Related Questions