简体   繁体   中英

Error installing mysql-python module on Win7 & Python 2.7

Whatever I try : downloading the tarball archive of mysql-python and running python setup.py install , or using easy_install mysql-python , I got the same error which is, (translated from French) : WindowsError: [Error 2] Can't find the specified file

The error occurs in the setup_windows.py file, line 7 which is : serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])

If someone has an idea of what's wrong ??? Thanks


OK, new element : in the mysql-python source package, there's a site.cfg file that needs to be tuned. # 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 My problem is that my dev box doesn't host the MySQL server which runs on another box. Thus, there's no MySQL installation to be found on my PC.

I got some answers from Installing python-mysql with wamp's mysql


OK Up and running. Get the clue from http://lyilei.wordpress.com/2011/03/22/install-mysqldb-python/ and ended up grabbing the unofficial binary installer from the given URL : http://www.lfd.uci.edu/~gohlke/pythonlibs/

But... this binary package is tied to MySQL 5.1.

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

右键单击您的python可执行文件,然后转到属性/可计算性,然后设置复选框以管理员身份运行。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM