1

全部 - 尽管我尽了最大的努力,随机的互联网帖子和看似相关的 Stack Overflow 线程,我还是无法在我的 Mac(OS Mountain Lion)上成功安装 NumPy。

从各种来源来看,我的理解是我必须安装 XCode 和开发人员命令行工具,我已经完成了这两件事。但是,根据下面的终端打印输出,仍然有问题。

如果有人能指出我正确的方向,也许还可以解释为什么首先安装 Python 模块如此困难(我也遇到了 scikit-learn 的问题),我将不胜感激。

非常感谢。

终端打印:

上次登录时间:7 月 2 日星期二 21:32:39 在 ttys000 amormachines-macbook:~ amormachine$ pip install numpy 下载/解包 numpy 运行 setup.py egg_info for package numpy 从 numpy 源目录运行。'/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils' 中不存在的路径:'site.cfg' F2PY 版本 2 blas_opt_info:找到: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']

build_src
building py_modules sources
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: gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3

compile options: '-I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/private -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/npymath -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/multiarray -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/umath -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/npysort -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
gcc-4.0: _configtest.c
sh: gcc-4.0: command not found
sh: gcc-4.0: command not found
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
  File "<string>", line 16, in <module>
  File "/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/setup.py", line 214, in <module>
    setup_package()
  File "/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/setup.py", line 207, in setup_package
    configuration=configuration )
  File "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/core.py", line 186, 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 "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/egg_info.py", line 8, in run
    self.run_command("build_src")
  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 "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py", line 152, in run
    self.build_sources()
  File "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py", line 163, in build_sources
    self.build_library_sources(*libname_info)
  File "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py", line 298, in build_library_sources
    sources = self.generate_sources(sources, (lib_name, build_info))
  File "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources
    source = func(extension, build_dir)
  File "/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/setup.py", line 648, in get_mathlib_info
    raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
Complete output from command python setup.py egg_info:
Running from numpy source directory.

'/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils' 中不存在的路径:'site.cfg'

F2PY 版本 2

blas_opt_info:

成立:

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:

成立:

extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']

define_macros = [('NO_ATLAS_INFO', 3)]

extra_compile_args = ['-msse3']

运行 egg_info

运行 build_src

build_src

构建 py_modules 源

构建库“npymath”源

自定义 Gnu95FCompiler

找不到可执行的 gfortran

找不到可执行文件 f95

自定义 NAGFCompiler

自定义 AbsoftFCompiler

找不到可执行文件 f90

找不到可执行文件 f77

自定义 IBMFCompiler

找不到可执行的 xlf90

找不到可执行的 xlf

自定义 IntelFCompiler

找不到可执行的 ifort

找不到可执行的 ifc

自定义 GnuFCompiler

找不到可执行的 g77

自定义 G95F 编译器

找不到可执行的 g95

自定义 PGroupFCompiler

找不到可执行的 pgfortran

不知道如何在平台 'posix' 上编译 Fortran 代码

C 编译器:gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3

编译选项:'-I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/private -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build /numpy/numpy/core/src -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core-I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build /numpy/numpy/core/src/npymath -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/multiarray -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn /T/pip-build/numpy/numpy/core/src/umath -I/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/src/npysort -I/private/var /folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'

gcc-4.0:_configtest.c

sh:gcc-4.0:找不到命令

sh:gcc-4.0:找不到命令

失败。

删除:_configtest.c _configtest.o

回溯(最近一次通话最后):

文件“”,第 16 行,在

文件“/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/setup.py”,第 214 行,在

setup_package()

setup_package 中的文件“/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/setup.py”,第 207 行

configuration=configuration )

文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/core.py”,第 186 行,在设置中

return old_setup(**new_attr)

文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py”,第 152 行,在设置中

dist.run_commands()

文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py”,第 953 行,在 run_commands

self.run_command(cmd)

文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py”,第 972 行,在 run_command

cmd_obj.run()

文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/egg_info.py”,第 8 行,运行中

self.run_command("build_src")

文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py”,第 326 行,在 run_command

self.distribution.run_command(command)

文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py”,第 972 行,在 run_command

cmd_obj.run()

运行中的文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py”,第 152 行

self.build_sources()

文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py”,第 163 行,在 build_sources

self.build_library_sources(*libname_info)

文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py”,第 298 行,在 build_library_sources

sources = self.generate_sources(sources, (lib_name, build_info))

文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/distutils/command/build_src.py”,第 385 行,在 generate_sources

source = func(extension, build_dir)

文件“/private/var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy/numpy/core/setup.py”,第 648 行,在 get_mathlib_info

raise RuntimeError("Broken toolchain: cannot link a simple C program")

RuntimeError:损坏的工具链:无法链接简单的 C 程序


命令 python setup.py egg_info 失败,错误代码 1 在 /var/folders/wk/r5j_bvnd28bd2ff42jctw8n80000gn/T/pip-build/numpy 存储完整登录 /Users/amormachine/.pip/pip.log amormachines-macbook:~ amormachine$

4

0 回答 0