Python:如何在Windows 7 x64上安装mysqldb?

Fed*_*omp 18 python mysql 64-bit windows-7

我尝试在Windows x64上安装Mysql-python.

我安装了python x64,setuptools(在叶子上检查,成功安装)但我无法安装mysqldb.我试图执行

C:\ Users\Fedcomp\Desktop\leaf-0.4\MySQL-python-1.2.3> python setup.py install

但赶上这个

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
Run Code Online (Sandbox Code Playgroud)

也尝试用msvc但是赶上这个(MS Visual express安装)

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
Run Code Online (Sandbox Code Playgroud)

如何在Windows x64上正确安装mysqldb? (来自原始mysql安装的头文件,因为在xampp服务器中它们不存在)

或者有人为windows python x64python x86编译mysqldb

Ben*_*end 35

编辑:mysqlclientPyPI上有32位和64位的二进制包.它是MySQL-python的一个分支,自2014年以来一直没有发布.

给后人的原始答案:

你可以在这里找到二进制安装程序(Python 2.6-3.2),这里(2.7)或这里(2.6).请注意,您不必在Windows x64上使用64位Python.您也可以使用32位版本的Python,其中有更多预先构建的第三方软件包.