开发者

Registry error when installing MySQL-python into virtualenv using pip and easy_install

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:\virtu开发者_如何转开发alenvs\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


Try ActivePython:

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

no compile orgy. no strange errors. no terror.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜