logo
Header graphic 6 of 9

Categories

Archives

Other stuff

Other sites

I wish this site were powered by Django

October 02nd, 2007

simplejson 1.7.x, ActiveState Python and the Visual Studio 2003 compiler

Filed under: Python, Technology — jm @ 20:37

If you’re trying to install a Python library like simplejson that uses code written in C or C++, you might run into this error message:

error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing “-c mingw32″ to setup.py.

There seem to be 2.5 possible fixes. 2 of them fix the issue directly, the .5 is a work-around for simplejson:

  1. Install Visual Studio 2003 or at least the non-optimizing C++-compiler that Microsoft delivers with the free .NET SDK. Finding the right version might be an issue though. This fix doesn’t work for me, as I have Visual Studio 2005 installed here already.

  2. Use a Win32 port of the GCC C++ compiler. Details on how to compile simplejson 1.7 with the MingW32-GCC C-compiler.

  3. Disable the C-extensions altogether by using this work-around:

    python setup.py –-without-speedups bdist_[whatever]

I simply chose the work-around. I don’t know if there are similar command-line switches for other libraries, but for my current project the performance of json-parsing code is not an issue.

Comments are closed.