如何将Python默认编译器更改为GCC? [英] How to change Python default compiler to GCC?

查看:510
本文介绍了如何将Python默认编译器更改为GCC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了Windows 10和Python 2.7.当我运行IDLE时,我发现: Python 2.7.10(默认,2015年10月14日,16:09:02) [MSC v.1500 32位(Intel)]

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)]

我希望此处的默认编译器是MinGW的GCC(我已经安装了MinGW),因为我无法使用MSC编译器导入Theano.

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

我尝试了所有教程,每次成功安装Theano时,但是尝试导入它时,出现错误使用以下命令行在编译过程中出现问题:",并且得到了大量错误.顺便说一句,我的系统上没有安装VS

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

推荐答案

编辑Distutils配置文件C:\ Python2.7 \ Lib \ distutils \ distutils.cfg(如果尚不存在,则创建该文件).

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

compiler = mingw32

这应该有效.

这篇关于如何将Python默认编译器更改为GCC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆