我遵循了在Mavericks上安装SciPy的建议here,并运行:
brew install python3
pip3 install virtualenv nose
brew install numpy --with-python3
brew install scipy --with-python3
brew test numpy
brew test scipy并没有遇到任何麻烦,直到最后一个命令,它产生:
Testing scipy
==> python -c import scipy; assert not scipy.test().failures
Python version 2.7.5 (default, Mar 9 2014, 22:15:05) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
nose version 1.3.4
Traceback (most recent call last):
File "<string>", line 1, in <module>
AssertionError
Error: scipy: failed
Failed executing: python -c import\ scipy;\ assert\ not\ scipy.test().failures
/usr/local/Library/Homebrew/formula.rb:585:in `system'
/usr/local/Library/Taps/homebrew/homebrew-python/scipy.rb:78:in `block (2 levels) in <class:Scipy>'
/usr/local/Library/Homebrew/language/python.rb:25:in `call'
/usr/local/Library/Homebrew/language/python.rb:25:in `block in each_python'
/usr/local/Library/Homebrew/language/python.rb:17:in `each'
/usr/local/Library/Homebrew/language/python.rb:17:in `each_python'
/usr/local/Library/Taps/homebrew/homebrew-python/scipy.rb:77:in `block in <class:Scipy>'
/usr/local/Library/Homebrew/formula.rb:509:in `block in run_test'
/usr/local/Library/Homebrew/extend/fileutils.rb:21:in `mktemp'
/usr/local/Library/Homebrew/formula.rb:507:in `run_test'
/usr/local/Library/Homebrew/cmd/test.rb:59:in `block (2 levels) in test'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/usr/local/Library/Homebrew/cmd/test.rb:58:in `block in test'
/usr/local/Library/Homebrew/cmd/test.rb:37:in `each'
/usr/local/Library/Homebrew/cmd/test.rb:37:in `test'
/usr/local/Library/brew.rb:136:in `<main>'当我打开python3并输入import scipy; scipy.test()时,我得到了成百上千的错误和几十个失败的测试:
FAILED (KNOWNFAIL=276, SKIP=920, errors=326, failures=42)
<nose.result.TextTestResult run=16412 errors=326 failures=42>我做错什么了?我之前安装了一堆软件(如Python),然后卸载了所有软件并重新开始,但可能做得不是很干净。我可以在不重新安装Mavericks的情况下挽救它吗?
同时,Homebrew安装了NumPy依赖的GCC 4.9,但这个输出表明我仍然在使用我在XCode上安装的任何东西。这可能是一个单独的问题,但gcc -v给了我:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix我提到它的原因是,我想知道我的系统是否造成了更大的问题。
发布于 2014-11-16 12:59:06
这些错误是虚假的,可以忽略。这将在即将发布的scipy中修复。解释这个问题的关键在于:https://github.com/scipy/scipy/issues/3853
Homebrew-python scipy公式现在应用了scipy将在下一个版本中应用的相同修复;在brew update && brew reinstall scipy之后,brew test scipy将通过。
发布于 2014-11-16 11:28:42
我在使用Python2.7时也遇到了同样的问题。我尝试了几种不同的方法:
本地在/usr/
要使用默认sudo ln -s /usr/local/Cellar/gcc/4.9.2/bin/gcc-4.9 /usr/local/bin/gcc
brew install scipy --default-fortran-flags
我仍然收到与您在响应brew test scipy时描述的错误相同的错误。运行numpy的测试套件没有产生错误。
https://stackoverflow.com/questions/26889467
复制相似问题