2014-01-10 58 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%确定的)。