2

The latest Strawberry Perl (5.18.1) and Python(x,y) (2.7.5) both come with MingW to compile C code in modules and extensions. One has to come before the other in my system path. That ensures, AFAIK, that cpan and pip would both use only one mingw installation.

However, the versions differ: Strawberry Perl comes with GCC 4.7 while Python(x,y) comes with 4.5. That would make one language's modules binary incompatible with its interpreter.

How can I ensure each language uses the "right" MingW version?

  • 2
    Python has a configuration mechanism (see [`distutils.ccompiler`](http://docs.python.org/2/distutils/apiref.html#module-distutils.ccompiler) and `distutils.sysconfig` for details), which you could use to configure it to point at `'gcc4.5'`, or the absolute path to Python(x,y)'s gcc (either way, you can then put 4.7 higher on the PATH and it won't get in the way)… but it may be easier to just write a script which swaps around your `%PATH%` as needed. – abarnert Oct 09 '13 at 21:07
  • Meanwhile, are you use that using gcc 4.7 produces modules that don't work with your Python? Sure, it's not _guaranteed_ to work… but it _might_ work (on my Mac, I build modules with clang 4.1 for Pythons compiled with clang 3.0 or gcc 4.2 all the time…), and that would obviously be simplest. – abarnert Oct 09 '13 at 21:08
  • I thought about scripting a %PATH switch-out, but it doesn't meet my goals of reducing my administrative burden. I like the idea of `distutils.ccompiler` better. Thanks! – Michael Gatto Oct 09 '13 at 22:02
  • OK, in that case, I don't remember how to change the default configuration on Windows; all I remember is that when I had to do it, I ended up having to read some distutils source and/or manually search for things, because all of the documentation was Unix-only. Hopefully things are better nowadays—or, if not, someone else comes along to give you the steps. – abarnert Oct 09 '13 at 22:36

0 Answers0