2012-08-29 137 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中的設置。