2

The pip and easy install commands (install MySQL-python) provide the massive error listed below.

I've been looking around for an answer a while now on this site and through google. The recurring answer is to install python dev (pip install python-dev) however the response I receive is "no distributions at all found"

Does anyone know the correct syntax in order to do this? or could someone be kind enough to point out where I'm going wrong.

All help is greatly appreciated. Thanks

    C:\virtualenvs\myvirtualenv2\Scripts\pip-script.py run on 04/13/11 16:28:18
Downloading/unpacking mySQL-python
  Running setup.py egg_info for package mySQL-python
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "C:\virtualenvs\myvirtualenv2\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:\virtualenvs\myvirtualenv2\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
Exception information:
Traceback (most recent call last):
  File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\basecommand.py", line 126, in main
    self.run(options, args)
  File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\commands\install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\req.py", line 980, in prepare_files
    req_to_install.run_egg_info()
  File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\req.py", line 216, in run_egg_info
    command_desc='python setup.py egg_info')
  File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\__init__.py", line 255, in call_subprocess
    % (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
Stu
  • 1,811
  • 5
  • 23
  • 27

2 Answers2

5

Try ActivePython:

pypm -E C:\virtualenvs\myvirtualenv2 install mysql-python

no compile orgy. no strange errors. no terror.

Community
  • 1
  • 1
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
3

Installing mysqldb on windows is tricky. I can install it manually, after downloading and unpacking mySQL-python:

  1. Go to MySQL-python-1.2.3 folder
  2. Edit the file site.cfg
  3. Run regedit in Start > Run and verify the proper path for MySQL, mine looks like SOFTWARE\MySQL AB\MySQL Server 5.1
  4. Uncomment the line registry_key
  5. Set it:

    registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1

  6. Run python setup.py install under your virtualenv
Thierry Lam
  • 45,304
  • 42
  • 117
  • 144
  • Cheers, Im running into "Unable to find vcvarsall.bat" any ideas? there's a compiler but this installs into the main Directory and not the virtual one? – Stu Apr 14 '11 at 08:48
  • Ive also tried the following however i receive error command 'gcc' failed: No such file or directory 1. Download minGW32 installer from sourceforge 2. When you install the tool and get the screen asking what components to install, select "MinGW base tools", "g++ compiler" and "MingW make". 3. After MinGW is installed, add C:\MinGW\bin to your Path environment variable 4. Create a file in C:\Python26\Lib\distutils and call it distutils.cfg 5. In this file, put the following: – Stu Apr 14 '11 at 09:19