尝试安装MySQL-python-1.2.3时出现错误

3 投票
2 回答
3544 浏览
提问于 2025-04-16 03:58

我在尝试安装 MySQL-python-1.2.3 时遇到了这个错误,有什么建议吗?

Traceback (most recent call last):
  File "C:\Documents and Settings\Desktop\MySQL-python-1.2.3\setup.py", line 15, in <module>
metadata, options = get_config()
  File "C:\Documents and Settings\Desktop\MySQL-python-1.2.3\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

我是在 Windows XP 机器上用 Python 2.7 来安装这个的。

2 个回答

1

这里有一个逐步的指南,教你如何解决这个问题:http://www.fuyun.org/2009/12/install-mysql-for-python-on-windows/

9

请查看这个页面:http://www.lfd.uci.edu/~gohlke/pythonlibs/,然后搜索"MySQL-python"。你会找到一些适用于Windows的MySQL-python预编译包。也许其中一个对你来说是合适的。

我发现,使用其中一个(针对Windows 7)是让MySQL-python在Windows上正常工作的唯一方法。

撰写回答