2014-01-10 87 views
0

我的MacPorts使用安裝python27並添加到/ opt/local/bin目錄路徑到PATH變量。當我執行which python時,我得到安裝在/opt/local/bin的那個很好。不過,我使用easy_install安裝鼻子,並且nosetests現在安裝在/ usr/local/bin中。在/ opt/local/bin中還有一個nosetests-2.7。我試着運行一個:鼻子python27和sklearn

/opt/local/bin/nosetests-2.7 --exe sklearn 

然而,一堆警告和成功的測試後,我最終得到如下:

ERROR: sklearn.cluster.bicluster.tests.test_utils.test_get_submatrix 
---------------------------------------------------------------------- 
Traceback (most recent call last): 
    File "/Library/Python/2.7/site-packages/nose-1.3.0-py2.7.egg/nose/case.py", line 197, in runTest 
    self.test(*self.arg) 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/cluster/bicluster/tests/test_utils.py", line 43, in test_get_submatrix 
    assert_true(np.all(X != -1)) 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 422, in assertTrue 
    if not expr: 
    File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/sparse/base.py", line 183, in __bool__ 
    raise ValueError("The truth value of an array with more than one " 
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all(). 

---------------------------------------------------------------------- 
Ran 1715 tests in 112.607s 

FAILED (SKIP=16, errors=1) 

不知道爲什麼被執行File "/Library/Python/2.7/site-packages/nose-1.3.0-py2.7.egg/nose/case.py"時,我清楚地跑了來自/ opt/local/bin目錄的nosetests。

任何幫助將非常感激!

UPDATE:

的結果:python -c 'import sys; print(sys.path)'

「[ '', '/Library/Python/2.7/site-packages/nose-1.3.0-py2.7.egg',「/ Library/Python/2.7/site-packages/Theano-0.6.0-py2.7.egg','/Library/Python/2.7/site-packages/scipy-0.13.2-py2.7-macosx-10.8-intel .egg ' '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',' /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2 0.7' , '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',「/opt/local/Library/Frameworks/Python.framework/Versions/2.7 /lib/python2.7/plat-mac','/opt/local/Library/Frameworks/Python.framework/Versions/2 .7/lib/python2.7/plat-mac/lib-scriptpackages','/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk','/ opt /local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old '' /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ LIB-dynload」, '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages']」

+0

'python -c'import sys;打印(sys.path)''說? –

+0

在問題中添加了命令的結果! – bytebiscuit

回答

1

在這個特定的測試中,它看起來像一個數值穩定性問題。除非您特別有興趣在該平臺上使用雙聚類模型,否則我不會太在意。

你也可以嘗試從git構建scikit-learn的當前主控。自上次發佈以來,此測試可能已經穩定下來(儘管我不是100%確定的)。