0

When running

$ pip install mysql-python

I'm getting the following error

> _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
> error: command C:\\Users\\Henry\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

I take this to mean it cannot find 'config-win.h' on my pc but it is on the pc within in the directory c:\Program Files\MySQL\MySQL Connector C 6.0.2\include

Can someone advice me what I've got wrong:

  1. Do I need to add this to my path?
  2. Does I need to get this into the Program Files (x86) structure instead

I tried using the approach suggested by Dominic but found a couple of mods needs to make it work

HenryM
  • 5,557
  • 7
  • 49
  • 105
  • 2
    Try this http://stackoverflow.com/questions/1972259/cannot-open-include-file-config-win-h-no-such-file-or-directory-while-inst – DominicEU Feb 13 '16 at 18:24
  • DominicEU's comment above has worked with a little tweek. Rather than just installing through pip and downloading from the web I've had to download the zip and extract it and then change the files. Instead of changing setup-windows.py as proposed I'vechanged to command in the file to connector=C:\Program Files\MySQL\MySQL Connector C 6.0.2. Also, I changed the include_dirs command rather than adding several lines. Finally, the install is run using python setup.py install rather than the normal pip install mysql-python BUT IT WORKED! :) – HenryM Feb 13 '16 at 20:47

1 Answers1

0

I've used the link provied by Dominic EU in his comments to the question above but I had to make a couple of changes.

  1. You have to download the zip file and unpack it into a directory in order to edit the files.
  2. This was in my site.cfg:

    connector = C:\Program Files (x86)\MySQL\Connector C 6.0.2

and I changed it to

 connector = C:\Program Files\MySQL\MySQL Connector C 6.0.2
  1. I did not need to make any changes to setup-windows.py because the current version downloaded already has the change

  2. Having made the changes and it is installed by moving to the directory you extracted the zip file and using

    python setup.py install

HenryM
  • 5,557
  • 7
  • 49
  • 105