2011-12-28 66 views
1

MySQL-Python(MySQLdb)是known to work with PyPy。如何你讓它工作?MySQL-Python與PyPy

我試圖downloading it和安裝:

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

然後我試圖下載這似乎已經安裝OK了ctypes implementation,但是嘗試使用它了:

... 
    File "C:\pypy-1.7\site-packages\django\db\backends\mysql\base.py", line 14, in <module> 
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) 
ImproperlyConfigured: Error loading MySQLdb module: Can't find a libmysqlclient 

我在在這一點上的損失。我如何使它工作

+0

關於你的第一個錯誤的事情:看看site.cfg和setup.cfg中mysqldb的所有路徑。其中一些在Windows 32位中存在不正確的默認值(「(x86)」,錯誤的路徑等)。那還是mysql的錯誤版本。如果你明白了,pypy + MySQLdb仍然無法在windows上運行,請讓我知道原因。 – fastmultiplication 2013-02-10 08:55:34

回答

1

你是對的,原來MySQLdb已知不能在PyPy上工作。

我從來沒有試圖在windows maschine上安裝mysql-ctypes,因爲我沒有安裝mysql-ctypes,但是您的路徑中是否安裝了libmysqlclient?

如果是這樣,你可以嘗試我的(可悲尚未合併)https://github.com/EnTeQuAk/mysql-ctypes分支,它支持更多版本的libmysqlclient。

+0

我試過你的叉子,不幸的是我得到了同樣的錯誤。我試着對這個'libmysqlclient'進行搜索,但我沒有找到任何有用的東西。 – Jonathan 2011-12-28 15:13:07

2

關於你與MySQL-ctypes的第二個錯誤,得到的答覆是該行

ctypes.util.find_library('mysqlclient') 

找不到窗口庫。它更改爲:

ctypes.util.find_library('mysqlclient.lib') 

我的系統上工作 - 但只有讓你到我的系統上的下一個錯誤(Windows錯誤193)。