简体   繁体   English

使用MinGW C编译器代替Microsoft Visual Studio Express for Python

[英]Using MinGW C compiler instead of Microsoft Visual Studio Express for Python

I am trying to install the python Package pyOpt and have difficulties using Microsoft Visual Studio Express because I am running a 64 bit install of Python. 我正在尝试安装python软件包pyOpt,由于使用64位安装的Python,因此在使用Microsoft Visual Studio Express时遇到了困难。

The pyOpt developers recommend using MinGW-W64 if the system doesn't have access to other c/Fortran compilers. 如果系统无法访问其他c / Fortran编译器,则pyOpt开发人员建议使用MinGW-W64。

I have now installed MinGW-W64 but it seems like the standard python setup.py install seems to still want to use VS. 我现在已经安装了MinGW-W64,但似乎标准的python setup.py install似乎仍然想使用VS。

How do I tell the installer to rather use MinGW's compiler instead? 如何告诉安装程序改用MinGW的编译器? Should MinGW come with the necessary c compiler out of the box or must I first install one in MinGW? MinGW是否应随需提供必要的c编译器,还是必须先在MinGW中安装一个?

  1. Just start %APPDATA%\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\vcvarsall.bat amd64 and you will get environment for 64-bit Python 只需启动%APPDATA%\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\vcvarsall.bat amd64 ,您将获得64位Python的环境

  2. MinGW compiler needs lot of tweaking in order to link with correct msvcr90.dll library but compiling with MinGW possible too - http://www.mingw.org/wiki/HOWTO_Use_the_GCC_specs_file MinGW编译器需要大量调整才能链接到正确的msvcr90.dll库,但也可以使用MinGW进行编译msvcr90.dll : //www.mingw.org/wiki/HOWTO_Use_the_GCC_specs_file

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM