#303 package fails to install on win7 x64, py27 x64

MySQLdb-1.2
closed
nobody
MySQLdb (285)
5
2013-11-21
2010-07-21
Sorin Sbarnea
No

py2.7 x64 on win7, tried the recommended install method: "pip install mysql_python"
pip install mysql_python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.3c1.tar.gz (89Kb): 89Kb downloaded
Running setup.py egg_info for package mysql-python
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\dev\mysite-cms\mysite\build\mysql-python\setup.py", line 15, in <module>
metadata, options = get_config()
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
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 14, in <module>

File "C:\dev\mysite-cms\mysite\build\mysql-python\setup.py", line 15, in <module>

metadata, options = get_config()

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


Command python setup.py egg_info failed with error code 1

Discussion

  • Andy Dustman
    Andy Dustman
    2010-07-21

    You have to set the registry key to the correct version of MySQL (it could be one of several possible values, depending on what you have installed) in site.cfg.

     
  • Tom Ekberg
    Tom Ekberg
    2010-09-14

    It would be easier to determine what the problem is if the following change were made:

    $ diff setup_windows.py setup_windows.py.orig
    7,12c7,8
    < try:
    < serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
    < mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
    < except WindowsError as e:
    < print r'Unable to find HKEY_LOCAL_MACHINE\%s in registry' % (options['registry_key'],)
    < raise


    serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
    mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
    

    The exception handler tells the user what was wrong explicitly. Getting the windows equivalent of 'File not found' is not very useful.

     
  • Andy Dustman
    Andy Dustman
    2012-09-07

    Changing this to Fixed mainly because the current code now avoids looking at the registry and instead uses a path to the MySQL C Connector library, which should be more stable.