安装Python的Mysql模块

3
我刚刚在我的win7机器上安装了Python 2.6。 现在我尝试安装mysqldb,但是运行“python setup.py install”时:
 C:\MySQL-python-1.2.3c1>python setup.py install
 Traceback (most recent call last):
   File "setup.py", line 15, in <module>
     metadata, options = get_config()
   File "C:\MySQL-python-1.2.3c1\setup_windows.py", line 7, in get_config
     serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
     options['registry_key'])
 WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
 (System cannot find the given file)

但是哪个文件呢? 感谢您的帮助!
2个回答

4

我已经使用Python26编译了MySQLdb 1.2.3c1,您可以在这里找到它。


1

你是从管理员模式命令提示符中运行吗?此外,编译器是否有可用于链接的MySQL头文件?

如果你只是一个终端用户,你可能会发现使用预构建的MySQLdb二进制文件更容易,因为在Windows上编译很麻烦。不幸的是,官方网站仍未针对2.6版本进行构建,但你可以下载其他人的构建版本。请参见this question以获取一些链接。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接