Python Numpy安装/构建Mac Osx

Python Numpy安装/构建Mac Osx,python,xcode,macos,numpy,python-2.7,Python,Xcode,Macos,Numpy,Python 2.7,因此,我按照这个网站上的说明,下载了Xcode和Fortran Gcc,然后从终端上运行以下程序: Megans-MacBook-Pro:~ MeganRCunninghan$ export CC=clang Megans-MacBook-Pro:~ MeganRCunninghan$ export CXX=clang Megans-MacBook-Pro:~ MeganRCunninghan$ export FFLAGS=-ff2c Megans-MacBook-Pro:~ MeganRCun

因此,我按照这个网站上的说明,下载了Xcode和Fortran Gcc,然后从终端上运行以下程序:

Megans-MacBook-Pro:~ MeganRCunninghan$ export CC=clang
Megans-MacBook-Pro:~ MeganRCunninghan$ export CXX=clang
Megans-MacBook-Pro:~ MeganRCunninghan$ export FFLAGS=-ff2c
Megans-MacBook-Pro:~ MeganRCunninghan$ git clone https://github.com/numpy/numpy.git
fatal: destination path 'numpy' already exists and is not an empty directory.
Megans-MacBook-Pro:~ MeganRCunninghan$ python setup.py build
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'setup.py': [Errno 2] No such file or directory
Megans-MacBook-Pro:~ MeganRCunninghan$ ls
Desktop     Dropbox     Pictures    my_new_env  virtualenv.pyc
Django      Library     Public      numpy
Documents   Movies      Sync Folder pip
Downloads   Music       git     virtualenv.py
Megans-MacBook-Pro:~ MeganRCunninghan$ cd numpy
Megans-MacBook-Pro:numpy MeganRCunninghan$ python setup.py build
Running from numpy source directory.
non-existing path in 'numpy/distutils': 'site.cfg'
F2PY Version 2
numpy/core/setup_common.py:86: MismatchCAPIWarning: API mismatch detected, the C API version numbers have to be updated. Current C api version is 8, with checksum f4362353e2d72f889fda0128aa015037, but recorded checksum for C API version 8 in codegen_dir/cversions.txt is 17321775fc884de0b1eda478cd61c74b. If functions were added in the C API, you have to update C_API_VERSION  in numpy/core/setup_common.py.
  MismatchCAPIWarning)
blas_opt_info:
  FOUND:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3)]
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']

lapack_opt_info:
  FOUND:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3)]
    extra_compile_args = ['-msse3']

running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
creating build
creating build/src.macosx-10.6-intel-2.7
creating build/src.macosx-10.6-intel-2.7/numpy
creating build/src.macosx-10.6-intel-2.7/numpy/distutils
building library "npymath" sources
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize NAGFCompiler
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize G95FCompiler
Could not locate executable g95
customize PGroupFCompiler
Could not locate executable pgfortran
don't know how to compile Fortran code on platform 'posix'
C compiler: clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3

compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
clang: _configtest.c
sh: clang: command not found
sh: clang: command not found
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
  File "setup.py", line 214, in <module>
    setup_package()
  File "setup.py", line 207, in setup_package
    configuration=configuration )
  File "/Users/MeganRCunninghan/numpy/numpy/distutils/core.py", line 184, in setup
    return old_setup(**new_attr)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/MeganRCunninghan/numpy/numpy/distutils/command/build.py", line 37, in run
    old_build.run(self)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Users/MeganRCunninghan/numpy/numpy/distutils/command/build_src.py", line 152, in run
    self.build_sources()
  File "/Users/MeganRCunninghan/numpy/numpy/distutils/command/build_src.py", line 163, in build_sources
    self.build_library_sources(*libname_info)
  File "/Users/MeganRCunninghan/numpy/numpy/distutils/command/build_src.py", line 298, in build_library_sources
    sources = self.generate_sources(sources, (lib_name, build_info))
  File "/Users/MeganRCunninghan/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources
    source = func(extension, build_dir)
  File "numpy/core/setup.py", line 644, in get_mathlib_info
    raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
Megans MacBook Pro:~MeganRCunninghan$export CC=clang
Megans MacBook Pro:~MeganRCunninghan$export CXX=clang
Megans MacBook Pro:~MeganRCunninghan$export FFLAGS=-ff2c
Megans MacBook Pro:~MeganRCunninghan$git克隆https://github.com/numpy/numpy.git
致命:目标路径“numpy”已存在,并且不是空目录。
Megans MacBook Pro:~MeganRCunninghan$python setup.py build
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:无法打开文件'setup.py':[Errno 2]没有这样的文件或目录
Megans MacBook Pro:~MeganRCunninghan$ls
桌面Dropbox图片my_new_env virtualenv.pyc
Django图书馆公共numpy
文档电影同步文件夹pip
下载音乐git virtualenv.py
Megans MacBook Pro:~MeganRCunninghan$cd numpy
Megans MacBook Pro:numpy MeganRCunninghan$python setup.py build
从numpy源目录运行。
“numpy/distutils”中不存在路径:“site.cfg”
F2PY版本2
numpy/core/setup\u common.py:86:不匹配HCAPIwarning:检测到API不匹配,必须更新C API版本号。当前C api版本为8,校验和为f4362353e2d72f889fda0128aa015037,但在codegen_dir/cversions.txt中记录的C api版本8的校验和为17321775fc884de0b1eda478cd61c74b。如果在C API中添加了函数,则必须在numpy/core/setup_common.py中更新C_API_版本。
不匹配(警告)
blas_opt_信息:
发现:
额外链接参数=['-Wl,-framework','-Wl,Accelerate']
定义_宏=[('NO_ATLAS_INFO',3)]
额外编译参数=['-msse3','-I/System/Library/Frameworks/vecLib.framework/Headers']
lapack_opt_信息:
发现:
额外链接参数=['-Wl,-framework','-Wl,Accelerate']
定义_宏=[('NO_ATLAS_INFO',3)]
额外编译参数=['-msse3']
运行构建
正在运行配置\u cc
统一config\u cc、config、build\u clib、build\u ext、build命令--编译器选项
运行配置功能
统一config\u fc、config、build\u clib、build\u ext、build命令--fcompiler选项
运行build\u src
构建src
构建py_模块源
创建构建
创建build/src.macosx-10.6-intel-2.7
创建build/src.macosx-10.6-intel-2.7/numpy
创建build/src.macosx-10.6-intel-2.7/numpy/distutils
建立图书馆“npymath”资源
定制GNU95F编译器
找不到可执行文件gfortran
找不到可执行文件f95
定制NAGFCompiler
定制绝对FTFCompiler
找不到可执行文件f90
找不到可执行文件f77
自定义IBMF编译器
找不到可执行文件xlf90
找不到可执行文件xlf
自定义英特尔编译器
找不到可执行ifort
找不到可执行文件ifc
定制gnuff编译器
找不到可执行文件g77
定制G95FCompiler
找不到可执行文件g95
自定义PGroupFCompiler
找不到可执行pgfortran
不知道如何在“posix”平台上编译Fortran代码
C编译器:clang-fno严格别名-fno common-dynamic-arch i386-arch x86_64-g-O2-DNDEBUG-g-O3
编译选项:'-Inumpy/core/src/private-Inumpy/core/src-Inumpy/core/src/npymath-Inumpy/core/src/multiarray-Inumpy/core/src/umath-Inumpy/core/src/npysort-Inumpy/core/include-I/Library/Frameworks/python2.7-c'
叮当声:_configtest.c
sh:clang:未找到命令
sh:clang:未找到命令
失败
正在删除:_configtest.c_configtest.o
回溯(最近一次呼叫最后一次):
文件“setup.py”,第214行,在
安装程序包()
文件“setup.py”,第207行,在setup\u包中
配置=配置)
文件“/Users/MeganRCunninghan/numpy/numpy/distutils/core.py”,第184行,在安装程序中
返回旧的\u设置(**新的\u属性)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py”,第152行,在安装程序中
dist.run_命令()
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py”,第953行,在run_命令中
self.run_命令(cmd)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py”,第972行,在run_命令中
cmd_obj.run()
文件“/Users/MeganRCunninghan/numpy/numpy/distutils/command/build.py”,第37行,正在运行
旧_build.run(self)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py”,第127行,处于运行状态
self.run_命令(cmd_名称)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py”,第326行,在run_命令中
self.distribution.run_命令(command)
文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py”,第972行,在run_命令中
cmd_obj.run()
文件“/Users/MeganRCunninghan/numpy/numpy/distutils/command/build_src.py”,第152行,正在运行
self.build_sources()
文件“/Users/MeganRCunninghan/numpy/numpy/distutils/command/build\u src.py”,第163行,内部版本源
自生成库源(*libname\u info)
文件“/Users/MeganRCunninghan/numpy/numpy/distutils/command/build\u src.py”,第298行,内建库源
sources=self.generate\u sources(sources,(库名称、构建信息))
文件“/Users/MeganRCunninghan/numpy/numpy/distutils/command/build_src.py”,第385行,在generate_sources中
source=func(扩展,生成目录)
文件“numpy/core/setup.py”,第644行,在get\u mathlib\u info中
raise RUNTIMERROR(“断开的工具链:无法链接简单的C程序”)
运行时错误:断开的工具链:无法链接简单的C程序

我已经为此工作了几个小时,所以现在不知所措。

我对
pip install numpy
没有任何问题。尽管您应该先安装。

我对
pip install numpy
没有任何问题。不过你应该先来。

我最近也遇到了类似的问题。我建议使用的numpy和scipy公式。他们将从源代码构建,但我对t没有问题