gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 20:59:02 26 4
gpt4 key购买 nike

我正在尝试在 windows x64 上安装 Mysql-python

我安装了python x64setuptools(检查了leaf库,安装成功)但是我无法安装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

也尝试使用 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

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

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

最佳答案

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

原始答案留给后人:

您可以找到二进制安装程序 here (Python 2.6-3.2), here (2.7) 或 here (2.6)。请注意,您不必在 Windows x64 上使用 64 位 Python。您也可以使用 Python 的 32 位构建,其中有更多预构建的 3rd 方包。

关于Python:如何在 Windows 7 x64 上安装 mysqldb?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5284186/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com