gpt4 book ai didi

python - 在 Win7 和 Python 2.7 上安装 mysql-python 模块时出错

转载 作者:行者123 更新时间:2023-11-30 23:51:32 24 4
gpt4 key购买 nike

无论我尝试什么:下载 mysql-python 的 tarball 存档并运行 python setup.py install,或使用 easy_install mysql-python,我都遇到了同样的错误是,(翻译自法语):WindowsError: [Error 2] Can't find the specified file

错误发生在 setup_windows.py 文件的第 7 行:serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])

如果有人知道出了什么问题???谢谢


OK,新元素:在mysql-python源码包中,有一个site.cfg文件需要调优。 # MySQL 的 Windows 注册表项。 # 这必须设置 Windows 构建才能工作。 # 如果你有不同的版本,只改变这个。 registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0我的问题是我的开发箱没有托管在另一个箱子上运行的 MySQL 服务器。因此,在我的 PC 上找不到 MySQL 安装。

我从 Installing python-mysql with wamp's mysql 得到了一些答案


OK 启动并运行。从http://lyilei.wordpress.com/2011/03/22/install-mysqldb-python/中获取线索并最终从给定的 URL 获取非官方的二进制安装程序:http://www.lfd.uci.edu/~gohlke/pythonlibs/

但是...这个二进制包与 MySQL 5.1 绑定(bind)。

最佳答案

如果不需要手动安装则转到此链接并下载 mysql 安装程序 http://www.lfd.uci.edu/~gohlke/pythonlibs/

关于python - 在 Win7 和 Python 2.7 上安装 mysql-python 模块时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7677560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com