代码之家  ›  专栏  ›  技术社区  ›  Han Zhengzu

如何更改python的默认gcc编译器

  •  0
  • Han Zhengzu  · 技术社区  · 7 年前

    我已经在我的计算机中安装了GCC4.9.2(MacOSX10.10,64位),而GCC4.2版本是在Python环境中显示的。我不知道为什么会这样。

    1.Python shell

    ▶ python
    Python 3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:11) 
    [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    

    ▶ gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
    Target: x86_64-apple-darwin14.0.0
    Configured with: ../gcc-4.9-20141029/configure --enable-languages=c++,fortran
    Thread model: posix
    gcc version 4.9.2 20141029 (prerelease) (GCC)   
    

    我认为这个问题可能是因为gcc编译器是在python之后安装的。如何解决这个问题,希望您的意见。

    1 回复  |  直到 6 年前
        1
  •  0
  •   janneb    7 年前

    [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] 当您启动python时得到的交互式shell是用来编译python解释器的编译器,它与f2py使用哪个编译器无关。