54

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.

Community
  • 1
  • 1
Switch
  • 14,783
  • 21
  • 69
  • 110

6 Answers6

47

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.

YOU
  • 120,166
  • 34
  • 186
  • 219
  • I'd upvote you twice if I could. This would be great to have on the Python-MySQL site: http://sourceforge.net/projects/mysql-python/ – Joe Dec 22 '10 at 19:24
  • 5
    for Py 2.7 on Win32, use this: http://soemin.googlecode.com/files/MySQL-python-1.2.3c1.win32-py2.7.exe – smattmyers Nov 30 '11 at 05:15
  • Also run into this problem trying to build Mercurial and install it into Python that is embedded in the Bitnami Trac Stack. – Warren P Jun 26 '12 at 14:52
  • 1
    Managed to install from http://www.codegood.com/archives/129 (Python 2.7 32 and 64), the above install links gave me errors – Timm Aug 07 '12 at 23:22
14

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

Logan Bibby
  • 1,167
  • 1
  • 10
  • 31
9

You can also try this: http://blog.eddsn.com/2010/05/unable-to-find-vcvarsall-bat/

john
  • 315
  • 3
  • 5
8

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.

eeerahul
  • 1,629
  • 4
  • 27
  • 38
tinylamb
  • 81
  • 1
  • 1
4

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.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
1

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

This made it easy.

nu everest
  • 9,589
  • 12
  • 71
  • 90