views:

1118

answers:

1

Hi,

Setting up a virtualenv for the first time, when i try to install MySQL-python using

pip -E <<some virtual env>> install MySQL-python

i get

File "setup_windows.py", line 7, in get_config

    serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])

WindowsError: [Error 2] The system cannot find the file specified

I guess virtualenv is stopping python from accessising the windows registry somehow, i have tried running easy_install within the virtualenv with no luck (i assume this does exactly the same thing), copying over the site packages dir from my main python install means that yolk will not see it,

Does anyone know how i can either cajole this into working, or copy over the files needed for mysql support?

Thanks,

+2  A: 

site.cfg in the same dir as setup.py was looking for the wrong regsitry key, at the end of the file is

# The Windows registry key for MySQL.
# This has to be set for Windows builds to work.
# Only change this if you have a different version.
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0

I dipped into the registry and found HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB\ and saw i had 5.1 instead,

reporting another error now, but this question is solved at least ;)

dysmsyd
Do you remember the what the new error was? I'm getting the following (after having the problem you first described):fatal error c1083: Cannot open include file: 'config-win.h': No such file or directory
saturdayplace
@saturdayplace, afraid not, but going down this path meant (at the time anyway) my webserver has to compile mysql-python ... which i did not want, so i decided to not use --no-site-packages )
dysmsyd