我想從蟒蛇連接到MySQL數據庫Python不能安裝mysql庫
我試着這樣做:pip install mysql-python
因爲這個問題提出No module named MySQLdb
,但我得到這個例外
Cleaning up...
Command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\use
rs\\user\\appdata\\local\\temp\\pip_build_User\\mysql-python\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-kkagjy-re
cord\install-record.txt --single-version-externally-managed --compile failed wit
h error code 1 in c:\users\user\appdata\local\temp\pip_build_User\mysql-python
Storing debug log for failure in C:\Users\User\pip\pip.log
在我的python代碼中,我一直收到這個錯誤
No module named MySQLdb
我使用Windows 7
你需要一個C編譯器和工具鏈設置安裝此。你有沒有安裝c編譯器?您使用什麼操作系統?您可能想看看這篇博客文章:http://mysql-python.blogspot.ca/2012/11/is-mysqldb-hard-to-install.html – shuttle87
@ shuttle87我正在使用Windows 7 –
@ shuttle87博客你建議我必須有'vs2008'的統計數據,這是不可能的。我有'vs2012' –