2

I'm trying to run a django project in a Windows machine, but it keeps given me this error:

 File "C:\Anaconda\lib\site-packages\django\db\backends\mysql\base.py", line 17, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

The after some google search I found that the mysql-python library is necessary, for that I'm trying the command: pip install mysql-python, but keeps given me the following error:

C:\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -Dversion_info=(1,2,5,'fin
al',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0
.2\include" -IC:\Anaconda\include -IC:\Anaconda\PC -c _mysql.c -o build\temp.win
-amd64-2.7\Release\_mysql.o /Zl

gcc.exe: error: /Zl: No such file or directory

error: command 'C:\\Anaconda\\Scripts\\gcc.bat' failed with exit status 1

I'm googling about it but no luck so far. Any idea how to solve this problem ?

-- UPDATE @iwin, I tried to install what you recommend but this is what I received: enter image description here enter image description here

2 Answers 2

1

I didnt get mysql-python (mysqldb) work with anaconda (2/3) or python 2.7/3.4 or pip.... Solution see here http://www.manejandodatos.es/2014/02/anaconda-mysql/

Sign up to request clarification or add additional context in comments.

Comments

1

I ran into the same problem and eventually found the following solution. The only thing that was different from our solutions was that I am using cygwin.

http://www.reddit.com/r/Python/comments/33i99j/does_anyone_know_how_to_install_mysqldb_with/

  1. Go to your Anaconda Scripts directory (C:/Anaconda/Scripts)
  2. In console type the following: conda install mysql-python

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.