views:

1220

answers:

2

I'm trying to install mysql-python in a virtualenv using pip on windows. At first, I was getting the same error reported here, but the answer there worked for me too. Now I'm getting this following error:

_mysql.c(34) : Fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory

edit: If I symlink (Win7) to my regular (not the virtualenv's) python's site-packages/MySQLdb dir I get Error loading MySQLdb module: No module named _mysql.

I'm rather at a loss here. Any pointers?

A: 

Installing dev bits for mysql got rid of the config-win.h error I was having, and threw another. Failed to load and parse the manifest. The system cannot find the file specified. I found the answer to my problem in this post: http://www.fuyun.org/2009/12/install-mysql-for-python-on-windows/.

I copied the file 'C:\Python26\Lib\distutils\msvc9compiler.py` into my virtualenv, made the edit suggested in the above link, and things are working fine.

saturdayplace
Quick question about "Installing dev bits for mysql got rid of the config-win.h error". What are "dev bits" and where can I get them? =)I'm having a similar issue.
John
+1  A: 

Most probably the answer is to install MySQL Developer Build and selecting "C headers\libs" option during configuration. (as reported in this entry: Building MySQLdb for Python on Windows on rationalpie.wordpress.com)

Maybe even better solution is to install a precompiled build: http://www.technicalbard.com/files/MySQL-python-1.2.2.win32-py2.6.exe

chodorowicz