我按照建议here在小牛队上安装SciPy并运行:
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),然后卸载了所有东西并重新开始,但可能并没有这么干净。我可以在没有重新安装小牛的情况下挽救这个吗?
与此同时,Homebrew安装了GCC 4.9作为NumPy的依赖,但是这个输出表明我还在使用我用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
我提到它的原因是我想知道我的系统是否造成了更大的问题。
答案 0 :(得分:2)
这些错误是虚假的,可能会被忽略。这将在即将发布的scipy中修复。解释此问题的scipy问题在这里:https://github.com/scipy/scipy/issues/3853
Homebrew-python scipy公式现在应用scipy将在下一个版本中应用的相同修复程序;在brew update && brew reinstall scipy
之后,brew test scipy
将通过。
答案 1 :(得分:0)
我使用Python 2.7遇到了同样的问题。我尝试了几件不同的事情:
创建名为&#34; gcc&#34;的软链接到/ usr / local / bin中的gcc-4.9这样
当我执行which gcc
sudo ln -s /usr/local/Cellar/gcc/4.9.2/bin/gcc-4.9 /usr/local/bin/gcc
告诉brew使用默认的FORTRAN标志:
brew install scipy --default-fortran-flags
我仍然遇到与您在回复brew test scipy
时描述的错误相同的错误。运行numpy的测试套件没有产生任何错误。