Windows: Unable to find vcvarsall.bat (cython, other c extensions)

This article is mostly moot. To build Python C extensions, please see the article "Building Python extensions with Canopy".

The error message "Unable to find vcvarsall.bat" occurs on Windows when attempting to build / install a Python package which contains C code. 

The solution is to install MS Visual C++ 2008, the compiler which is used to compile python 2.x itself. You must compile with the same bit length (32 or 64) as the version of Canopy/Python where you wish to use the compiled C code.

The most economical solution, whether on 32-bit or 64-bit Windows, is to use Canopy's 32-bit version, which generally has equivalent functionality to the 64-bit version, unless you are working with large data arrays. At last report, 32-bit Visual C++ Express was available at these MS sites:

http://go.microsoft.com/?linkid=7729279

http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso

For compatibility with 64-bit Canopy/Python, you can purchase MS Visual Studio 2008 (not the Express version), which is available online from various vendors for about US $200. 

(For simple C code, Mingw will sometimes suffice instead of Visual Studio, but there is a danger of library conflicts which may cause difficult-to-trace bugs, so we do not use it in our package builds, nor recommend its use.) 

Update: The comments below the article also offer other more recent solutions.

Have more questions? Submit a request

Comments

Powered by Zendesk