[SciPy-User] scipy.weave on windows vista compiling error

federico vaggi vaggi.federico at gmail.com
Mon May 21 18:13:30 EDT 2012


> Message: 2
> Date: Mon, 21 May 2012 11:36:13 +0000 (UTC)
> From: Tobias <tobias at ebockwurst.de>
> Subject: [SciPy-User] scipy.weave on windows vista compiling error
> To: scipy-user at scipy.org
> Message-ID: <loom.20120521T131903-9 at post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
>
> Hello!
>
> I'm trying to bring scipy.weave to work on Windows Vista with MinGw.
> I use Python 2.7.1, Scipy 0.10.1 and MinGw 4.6.2
> My code looks like the following:
>
>  from scipy import weave
>  weave.inline("""print('Hello World!');""", [], compiler = 'mingw32-gcc')
>
> I get the following error message:
>
>  DistutilsPlatformError: don't know how to compile C/C++ code on platform
> 'nt'
>  with 'mingw32-gcc' compiler
>
> With MinGw come a lot of different compiler. If I choose not 'mingw32-gcc'
> but
> for example 'gcc' weave complains
>
>  ValueError: invalid version number '4.'
>
> So I also downloaded the olf MinGW 2.9.5 Version. Then I also get the Error
> "don't know how to compile C/C++ code on platform 'nt'"
>
> The PATH-Variables are set and I also made shure, that there is write
> access to
> the MinGw and Python folders. Searching for this error message gave no
> progress, but maybe you could help me. Would be great!
>
> All the best
> Tobi
>
>
Your C++ compiler has to match the C++ compiler used to compile Python -
which, I think, by default, on Vista is Visual Studio 2008.

However, the weave module is not actively maintained, and there are much
better options right now for interfacing with C/C++.  I would highly
suggest that if you have some performance-critical part of your code, you
either use Cython, or, if it is a simple numerical expression, use the
amazing numexpr package.

I warn you though - while pure Python code is very portable across
platforms, interfacing Python with other libraries (mostly, C and C++) is a
huge pain on Windows.  If you really want to continue, I strongly advise
you take advantage of Christoph Gohlke's work:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

who has done all the hard work has made binary installers for most of the
hard-to-compile Python libraries with C and C++ dependencies.

Federico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120522/cdf7e4b0/attachment.html>


More information about the SciPy-User mailing list