numpy.test失败并显示失败:test_error_message(test_utils.TestEqual)

时间:2017-09-28 23:34:40

标签: python numpy

我是Python的新手,所以手指越过这是一个简单的错误!

从anaconda提示符运行以下代码时出现错误;

python -c "import numpy; numpy.test()"

错误消息是;

FAIL: test_error_message (test_utils.TestEqual)

更多信息超越了我的脑海;

File "C:\ProgramData\Anaconda22\lib\site-packages\numpy\testing\tests\test_utils.py", line 272, in test_error_message
    "\nArrays are not equal\n\n"
AssertionError: '\nArrays are not equal\n\n(shapes (2L,), (1L, 2L) mismatch)\n x: array([1, 2])\n y: [repr failed for <matrix>: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()]' != '\nArrays are not equal\n\n(shapes (2,), (1, 2) mismatch)\n x: array([1, 2])\n y: [repr failed for <matrix>: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()]'

我真的不知道如何解决这个问题。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

好的,所以我不确定为什么会这样,但是我用Numpy卸载了

conda uninstall numpy

然后重新安装numpy;

conda install numpy

然后重新安装卸载numpy时卸载的所有软件包;

conda install astropy bottleneck dask datashape distributed h5py matplotlib numba numexpr numpy odo pandas patsy pygpu pytables pywavelets scikit-image scikit-learn scipy seaborn statsmodels theano 

Bingo bango,不再失败!