python error when compile file in windows


It is a common problems when compile some source file in python. The error message is as followed:
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 installled,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.

There is some solution for this, for example, make a static .lib file for yourself. But if cygwin is installed, you can create a cfg in "C:\Python25\Lib\distutils" named as distutils.cfg, and input the following content:
[build]
compiler=mingw32

this will change the default compiler from visual studio to gcc and finish the install process.

posted on 2010-07-29 23:19  xueliangliu  阅读(180)  评论(0编辑  收藏  举报

导航