[英]nose python27 and sklearn
I've installed python27 using MacPorts and have added the /opt/local/bin path to the PATH variable. 我已经使用MacPorts安装了python27,并将/ opt / local / bin路径添加到PATH变量中。 When I execute
which python
I get the one installed at /opt/local/bin
which is fine. 当我执行
which python
,会在/opt/local/bin
安装一个,这很好。 However , I installed nose using easy_install and nosetests now is installed in /usr/local/bin. 但是,我使用easy_install安装了鼻子,现在将鼻子测试安装在/ usr / local / bin中。 There is a nosetests-2.7 in /opt/local/bin as well.
在/ opt / local / bin中也有一个nastests-2.7。 I've tried running that one:
我试过运行那个:
/opt/local/bin/nosetests-2.7 --exe sklearn
However, after a bunch of warnings and successful tests I end up getting the following: 但是,经过一连串的警告和成功的测试,我最终得到了以下几点:
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)
Not sure why File "/Library/Python/2.7/site-packages/nose-1.3.0-py2.7.egg/nose/case.py"
is being executed when I clearly ran the nosetests from /opt/local/bin directory. 当我清楚地从/ opt / local / bin运行鼻子测试时,不确定为什么执行
File "/Library/Python/2.7/site-packages/nose-1.3.0-py2.7.egg/nose/case.py"
目录。
Any help on this would be really appreciated! 任何帮助,将不胜感激!
UPDATE: 更新:
Results of: python -c 'import sys; print(sys.path)'
结果:
python -c 'import sys; print(sys.path)'
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.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/Py “ [”,“ / 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/版本/2.7/lib/python27.zip”、“/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7”、“/opt/local/Library/Frameworks/Python.framework/版本/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 / Py thon/2.7/site-packages']"
马拉松/ 2.7 /站点包]”
It looks like a numerical stability issue in this specific test. 在此特定测试中,它看起来像是一个数值稳定性问题。 I would not wary much about it unless your are specifically interested in using the bi-clustering model on that platform.
除非您对在该平台上使用双集群模型特别感兴趣,否则我不会对此特别担心。
You can also try to build the current master of scikit-learn from git. 您也可以尝试从git构建scikit-learn的当前大师。 This test might have been stabilized since the last release (although I am not 100% sure).
自上次发布以来,该测试可能已经稳定(尽管我不确定100%)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.