How to change Python default compiler to GCC?

2019-08-09 20:12发布

问题:

I have Windows 10 and Python 2.7 installed. When I run IDLE I find this: Python 2.7.10 (default, Oct 14 2015, 16:09:02) [MSC v.1500 32 bit (Intel)]

I want the default compiler here to be MinGW's GCC (I already installed MinGW) becaue I cannot import Theano with the MSC compiler

I tried all the tutorials out there and every time I successfully install Theano but when I try to import it I get the error "Problem occurred during compilation with the command line below:" and I get a huge list of errors. Btw, I don't have VS installed on my system

回答1:

Edit Distutils config file C:\Python2.7\Lib\distutils\distutils.cfg (Create the file if it already does not exist).

Add the following to the file:

[build]

compiler = mingw32

This should work.