我已经在计算机(mac osx 10.10,64位)中安装了gcc 4.9.2,而在Python环境中显示的是gcc 4.2。我不知道为什么会这样。
我在调用numpy.f2py函数时遇到了一些问题,我认为这可能与不兼容的gcc编译器有关。
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.
2。在终端
▶ 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)
我认为这个问题可能是由于在python之后安装了gcc编译器。如何解决此问题,希望为您提供建议。
答案 0 :(得分:0)
我相信[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
是在启动python交互式外壳程序时得到的,它是用来编译python解释器的编译器,与f2py一起使用的编译器无关。