Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics Say Hello to Django Django?

How to install mysql with django on windows 7.

I am trying to run the command "pip install MySQL-python" in my virtual environment but getting the following error :

_mysql.c
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':

No such file or directory error: command 'C:\Users\vkcsl0010\AppData\Local\Programs\Common\Micr osoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2.

Can you help in this urgently.

2 Answers

Hi Andreas

Thanks for the answer. I am using python 2.7 version only. I solved the problem by manually downloading the MySQL connector and installing it in my environment instead of running "pip install MySQL-python" which was giving me issues.

Thanks for the help.

Hi Vaibhav

What version of python are you using in your virtual enviroment? is it python 3.5. I had this issue and the only way i could fix this was to change my python version in my virtual enviroment to Python 2.7. You can change the version by following these steps.

1) actiavte the enviroment.
2) While in the virtual enviroment type the following 
virtualenv -p /usr/bin/python2.7 .  # the dot at the end stands for the current directory ie your VE
 #for windows use the logic above to find the correct path. 
3) now you can run pip install Mysql-python

python 3.5 and Mysql-python dont go very well together for some reason.

hope this helps.