Python distutils build problems with MinGW

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Jan 31 22:03:27 EST 2010


On Feb 1, 2:59 am, Andrej Mitrovic <andrej.mitrov... at gmail.com> wrote:
> Hi,
>
> I've made a similar post on the Cython mailing list, however I think
> this is more python-specific. I'm having trouble setting up distutils
> to use MinGW instead of Visual Studio when building a module. Even tho
> I've just uninstalled VS, and cleared out any leftover VS environment
> variables, distutils keeps wanting to use it.
>
> The steps I took:
>
> Fresh installation of Python 3.1.1
> Successfully installed MinGW, added to the path variable (gcc in
> command prompt works)
> Successfully installed Cython, imports from Cython in Python work.
> Added a distutils.cfg file in \Python31\Lib\distutils\ directory with:
>
> [build]
> compiler=mingw32
>
> (also tried adding [build_ext] compiler=mingw32)
>
> There's a demo setup.py module that came with Cython, I tried the
> following commands:
>
> ----------------------------------------------------
>
> > python setup.py build_ext --inplace
>
> error: Unable to find vcvarsall.bat
>
> > python setup.py build
>
> error: Unable to find vcvarsall.bat
> ----------------------------------------------------
>
> I'm having the exact same issue with trying to build the Polygon
> library via MinGW. In fact, the reason I had installed Visual Studio
> in the first place was to be able to build the Polygon library, since
> I was having these errors.
>
> What do I need to do to make distutils/python use MinGW?

Update:

I installed and tried building with Python 2.6, it calls MinGW when I
have the distutils.cfg file configured properly (same configuration as
the Python 3.1.1 one)

But why doesn't it work on a fresh Python 3.1.1 installation as well?
Is this a bug?



More information about the Python-list mailing list