我試圖安裝Mysql-python on windows x64。Python:如何在Windows 7 x64上安裝mysqldb?
我安裝蟒蛇64,setuptools的(在葉 LIB檢查,安裝成功),但我不能安裝MySQLdb的。 我試圖執行
C:\用戶\ Fedcomp \桌面\葉0.4 \ MySQL的 - 蟒蛇-1.2.3>蟒蛇 的setup.py安裝
但趕上這
In file included from _mysql.c:34:
D:\servers\xampp_server\xampp\mysql\include/config-win.h:211:1: warning: "finite
" redefined
D:\servers\xampp_server\xampp\mysql\include/config-win.h:164:1: warning: this is
the location of the previous definition
D:\servers\xampp_server\xampp\mysql\include/config-win.h:277:1: warning: "HAVE_S
TDDEF_H" redefined
In file included from D:\Python27\include/Python.h:8,
from pymemcompat.h:10,
from _mysql.c:29:
D:\Python27\include/pyconfig.h:673:1: warning: this is the location of the previ
ous definition
error: command 'gcc' failed with exit status 1
也與MSVC嘗試,但趕上這(安裝微軟的Visual快遞)
C:\Users\Fedcomp\Desktop\leaf-0.4\MySQL-python-1.2.3>python setup.py install bui
ld --compiler=msvc
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info\PKG-INFO
writing top-level names to MySQL_python.egg-info\top_level.txt
writing dependency_links to MySQL_python.egg-info\dependency_links.txt
reading manifest file 'MySQL_python.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
writing manifest file 'MySQL_python.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying MySQLdb\release.py -> build\lib.win-amd64-2.7\MySQLdb
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
如何在Windows x64上正確安裝mysqldb? (頭從原來的MySQL安裝,因爲在XAMPP服務器,他們不存在)
或者可能有人爲Windows編譯蟒蛇64或蟒蛇86MySQLdb的?
+1找到了。我會支持使用32位的建議。它確實讓生活更輕鬆。 – 2011-03-12 17:48:15
如果您已經安裝了另一個版本,那麼我會建議先刪除並安裝正確的版本。 – 2013-05-20 11:05:20
只是一個小小的評論:我試過第一個鏈接,它無法連接到我的數據庫(版本爲Python 2.7)。但第二個鏈接的驅動程序正常工作。 – dbf 2013-10-19 17:57:28