4

第一次设置 virtualenv,当我尝试使用安装 MySQL-python 时

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

我明白了

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

我猜virtualenv正在以某种方式阻止python访问Windows注册表,我尝试在virtualenv中运行easy_install但没有运气(我假设这完全一样),从我的主要python安装复制站点包目录意味着蛋黄会没看到,

有谁知道我如何哄骗它工作,或者复制mysql支持所需的文件?

谢谢,

4

1 回答 1

5

与 setup.py 在同一目录中的 site.cfg 正在寻找错误的注册表项,文件末尾是

# 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

我进入注册表并找到 HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB\ 并看到我有 5.1,

现在报告另一个错误,但这个问题至少解决了;)

于 2009-11-10T10:58:45.773 回答