2012-08-29 52 views
2

我尝试安装mysqldb for python,我是python的新手,对不起之前。 当我输入我的提示 “蟒蛇的setup.py安装”,这是味精:为python安装mysqldb

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

我使用Python 2.6中,mysq-蟒蛇1.2.3,7 32位的运行

回答

1

的二进制包现在有一个Windows MSI installer SourceForge上。尝试,但如果你更愿意建立自己的,现在(直到1.2.4发布),你应该能够做到这一点:

pip install http://svn.code.sf.net/p/mysql-python/svn/branches/MySQLdb-1.2/MySQLdb 

以上假定您已经安装了颠覆。您还需要安装适当的C connector。然后查看site.cfg中的设置。