我試圖在Lion OS自帶的Python 2.6上安裝numpy和scipy。使用gfortran支持的Lion Python 2.6構建numpy
以下是具體步驟我服用:
- 安裝的
- 獅子乾淨的副本,
- 更新,
- 的Xcode(從應用程序商店),
- 家釀,
- gfortran,
- pip,
- 和numpy。
- 下一步是嘗試升級numpy。
這是發生了什麼:。(我無法發佈完整的日誌,因爲我是一個有限的用戶
Downloading/unpacking numpy from http://pypi.python.org/packages/source/n/numpy/numpy- 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:?非常感謝您的幫助,請讓我知道,如果有適合我的方式(僅限美國呃)發佈完整的日誌。我得到一個錯誤,說我需要更多的信譽來發送很長的問題。如有必要,我可以將其上傳到網站或其他東西。乾杯 – NNsr 2012-08-05 14:50:13
你最好把它貼到一個pastebin(或者等同)代碼中,然後總結一下你的問題。 SO格式喜歡一個特定的點,而不是一個巨大的數據轉儲......請把此作爲一個建設性的批評請:)然後有足夠代表的人。可以編輯你的問題,或者可以發表評論,要求你挑出一些問題並修改你的問題......然後,希望你得到一個答案,並將其與所有相關點存檔以幫助其他人以後出... – 2012-08-05 15:05:55
您是否從Xcode安裝命令行工具? – tabchas 2012-08-05 15:23:14