Python issue:Unable to find vcvarsall.bat

PythonMysql

Python Problem Overview


> Possible Duplicate:
> error: Unable to find vcvarsall.bat

I'm trying to install MySql interface for python, but I got an error (mentioned below). And I know the solution: install Microsoft Visual C++. Is there any alternative solution apart from installing Microsoft Visual C++? I mean this has really hurt me; why should I install Microsoft Visual C++ just because to build this single package it's a useless and time-wasting approach from the developer's perspective. Is there any alternative solution for this issue?

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

I'm using Python 2.6 on Windows XP.

Python Solutions


Solution 1 - Python

You will need MSVC compiler or mingw32 to compile that, and also need MySQL Header files.

I've compiled once for MySQL1.2.3c1 for Python2.6, you could find it here.

Solution 2 - Python

I realize this question is over a year old. However, YOU's executables don't work for Win64 machines. I've found Christopher Gohlke's Python libraries extremely helpful: http://www.lfd.uci.edu/~gohlke/pythonlibs/.

For MySQL-python on Win64 and Py27: http://www.lfd.uci.edu/~gohlke/pythonlibs/49ej5jcn/MySQL-python-1.2.3.win-amd64-py2.7.exe

Solution 3 - Python

Solution 4 - Python

Installation of mysql-python is confusing. It wasted my hours to deal with errors. Finally, I encounter here. It refers a compiled file. Try it.

Solution 5 - Python

I don't know whether it helps you, but check out this forum thread, it could be a version issue.

> There are important differences between the several versions of VC++. The most important discrepancy is the runtime library version. Each version of Visual Studio uses its own msvcrt dll. The command line options, deprecated functions, project file formats and other things are also slightly different.

Solution 6 - Python

The easiest approach for me was to go here http://sourceforge.net/projects/mysql-python/ and get the executable.

This made it easy.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSwitchView Question on Stackoverflow
Solution 1 - PythonYOUView Answer on Stackoverflow
Solution 2 - PythonLogan BibbyView Answer on Stackoverflow
Solution 3 - PythonjohnView Answer on Stackoverflow
Solution 4 - PythontinylambView Answer on Stackoverflow
Solution 5 - PythonPekkaView Answer on Stackoverflow
Solution 6 - Pythonnu everestView Answer on Stackoverflow