Python 问题:找不到 vcvarsall.bat
可能重复的问题:
错误:找不到 vcvarsall.bat
我想为 Python 安装 MySql 接口,但遇到了一个错误(如下所示)。我知道解决办法是安装 Microsoft Visual C++。除了安装 Microsoft Visual C++ 之外,还有其他解决方案吗?我觉得这真的让我很沮丧;为什么我必须安装 Microsoft Visual C++ 仅仅是为了构建这个单一的包?从开发者的角度来看,这种做法真是没用又浪费时间。有没有其他解决这个问题的方法?
MySQL-python-1.2.3c1>setup.py install
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'
writing manifest file 'MySQL_python.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
copying MySQLdb\release.py -> build\lib.win32-2.6\MySQLdb
running build_ext
building '_mysql' extension
error: Unable to find vcvarsall.bat
我在 Windows XP 上使用 Python 2.6。
6 个回答
14
我知道这个问题已经有一年多了。不过,YOU的可执行文件在Win64机器上不太好用。我发现Christopher Gohlke提供的Python库非常有帮助:http://www.lfd.uci.edu/~gohlke/pythonlibs/.
如果你在Win64和Python 2.7上使用MySQL-python,可以下载这个链接的文件:http://www.lfd.uci.edu/~gohlke/pythonlibs/49ej5jcn/MySQL-python-1.2.3.win-amd64-py2.7.exe
47
你需要使用MSVC编译器或者mingw32来编译这个程序,还需要MySQL的头文件。
我之前为Python2.6编译过MySQL1.2.3c1,你可以在这里找到它。