【问题标题】:Building numpy for Lion Python 2.6 with gfortran support使用 gfortran 支持为 Lion Python 2.6 构建 numpy
【发布时间】:2012-08-02 18:39:15
【问题描述】:

我正在尝试在 Lion OS 随附的预装 Python 2.6 上安装 numpy 和 scipy。

这是我正在采取的具体步骤:

  • 安装一个干净的副本
    • 狮子,
    • 更新,
    • Xcode(来自应用商店),
    • 自制,
    • gfortran,
    • 点,
    • 和 numpy。
  • 下一步是尝试升级 numpy。
    以下是发生的情况:(我无法发布完整日志,因为我是受限用户。

Downloading/unpacking numpy from @987654321@    1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee

Downloading numpy-1.6.2.zip (2.9Mb): 2.9Mb downloaded Running setup.py egg_info for package numpy Running from numpy source directory.non-existing path in 'numpy/distutils': 'site.cfg' F2PY Version 2 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'] build_src building py_modules sources building library "npymath" sources customize NAGFCompiler Could not locate executable f95 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 Gnu95FCompiler Found executable /usr/local/bin/gfortran customize Gnu95FCompiler customize Gnu95FCompiler using config C compiler: llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno- common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall - Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes - DENABLE_DTRACE -arch i386 -arch x86_64 -pipe 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/include - I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c' llvm-gcc-4.2: _configtest.c sh: llvm-gcc-4.2: command not found sh: llvm-gcc-4.2: command not found failure. removing: _configtest.c _configtest.o Traceback (most recent call last): File "<string>", line 14, in <module> File "/Users/MYUSERNAME/build/numpy/setup.py", line 214, in <module> setup_package() File "/Users/MYUSERNAME/build/numpy/setup.py", line 207, in setup_package configuration=configuration ) File "/Users/MYUSERNAME/build/numpy/numpy/distutils/core.py", line 186, in setup return old_setup(**new_attr) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/egg_info.py", line 8, in run self.run_command("build_src") File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 333, in run_command File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 152, in run self.build_sources() File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 163, in build_sources self.build_library_sources(*libname_info) File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 298, in build_library_sources sources = self.generate_sources(sources, (lib_name, build_info)) File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 696, 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.non-existing path in 'numpy/distutils': 'site.cfg' F2PY Version 2 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 egg_info running build_src build_src building py_modules sources creating build creating build/src.macosx-10.7-intel-2.6 creating build/src.macosx-10.7-intel-2.6/numpy creating build/src.macosx-10.7-intel-2.6/numpy/distutils building library "npymath" sources customize NAGFCompiler Could not locate executable f95 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 Gnu95FCompiler Found executable /usr/local/bin/gfortran customize Gnu95FCompiler customize Gnu95FCompiler using config C compiler: llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe 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/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c' llvm-gcc-4.2: _configtest.c sh: llvm-gcc-4.2: command not found sh: llvm-gcc-4.2: command not found failure. removing: _configtest.c _configtest.o Traceback (most recent call last): File "<string>", line 14, in <module> File "/Users/MYUSERNAME/build/numpy/setup.py", line 214, in <module> setup_package() File "/Users/MYUSERNAME/build/numpy/setup.py", line 207, in setup_package configuration=configuration ) File "/Users/MYUSERNAME/build/numpy/numpy/distutils/core.py", line 186, in setup return old_setup(**new_attr) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/egg_info.py", line 8, in run self.run_command("build_src") File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 333, in run_command File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 152, in run self.build_sources() File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 163, in build_sources self.build_library_sources(*libname_info) File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 298, in build_library_sources sources = self.generate_sources(sources, (lib_name, build_info)) File "/Users/MYUSERNAME/build/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 696, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program") RuntimeError: Broken toolchain: cannot link a simple C program ---------------------------------------- Command python setup.py egg_info failed with error code 1 in /Users/MYUSERNAME/build/numpy Storing complete log in /Users/MYUSERNAME/Library/Logs/pip.log

我非常感谢任何帮助/评论/指导。

【问题讨论】:

  • @abarnert:非常感谢您的帮助。如果我(受限用户)有办法发布完整日志,请告诉我。我收到一条错误消息,说我需要更多声誉才能发送长问题。如有必要,我可以将其上传到网站或其他地方。干杯
  • 您最好将代码发布到 pastebin(或等效项)中,并总结您问题的兴趣点。 SO 格式喜欢一个特定的点,而不是大量的数据转储......请将此作为建设性的批评:) 然后是有足够代表的人。可以编辑您的问题,或者可以制作要求您挑选一些内容并修改您的问题的 cmets...交换条件...-然后,希望您能得到答案,并且它与所有相关点一起存档以帮助其他人稍后出...
  • 你是否从 Xcode 安装了命令行工具?
  • @tabchas:感谢您的评论一百万。我安装了命令行工具,它就像一个魅力!所以为了以后的参考,问题中提到的所有步骤都是正确的。只需添加以下步骤:安装 Xcode 后,转到 Xcode 首选项,下载,在组件选项卡下,安装命令行工具。非常感谢大家!
  • 嘿没问题...我前段时间购买 Macbook 时遇到了同样的问题。

标签: python numpy scipy gfortran


【解决方案1】:

你试过官方的安装说明吗?

http://www.scipy.org/Installing_SciPy/Mac_OS_X

【讨论】:

  • 官方安装只适用于从 python.org 下载的 Pythons
猜你喜欢
  • 1970-01-01
  • 2012-09-29
  • 2012-02-09
  • 2015-05-07
  • 2020-02-24
  • 2023-03-04
  • 1970-01-01
  • 2012-03-26
  • 2012-04-20
相关资源
最近更新 更多