【问题标题】:Numpy test() finished with errorsNumpy test() 以错误结束
【发布时间】:2014-02-08 20:18:22
【问题描述】:

在 ubuntu 12.04 x32 上,我通过 sudo apt-get install python-numpy 安装了 python 2.7.3、numpy 1.6.1。我通过numpy.test()从numpy运行test(),我得到:

失败:test_pareto (test_random.TestRandomDist)

Traceback(最近一次调用最后一次): 文件“/usr/lib/python2.7/dist-packages/numpy/random/tests/test_random.py”,第 313 行,在 test_pareto np.testing.assert_array_almost_equal(实际,期望,十进制=15) 文件“/usr/lib/python2.7/dist-packages/numpy/testing/utils.py”,第 800 行,在 assert_array_almost_equal header=('数组几乎不等于 %d 个小数' % decimal)) 文件“/usr/lib/python2.7/dist-packages/numpy/testing/utils.py”,第 636 行,在 assert_array_compare 引发 AssertionError(msg) 断言错误: 数组几乎不等于 15 位小数

(不匹配 16.6666666667%) x: 数组([[ 2.46852460e+03, 1.41286881e+03], [5.28287797e+07, 6.57720981e+07], [1.40840323e+02, 1.98390255e+05]]) y: 数组([[ 2.46852460e+03, 1.41286881e+03], [5.28287797e+07, 6.57720981e+07], [1.40840323e+02, 1.98390255e+05]])


在 17.483 秒内运行 3169 次测试

失败(KNOWNFAIL=3,SKIP=4,失败=1)

我该怎么办?我错过了一个依赖吗?

谢谢。

【问题讨论】:

    标签: python-2.7 ubuntu numpy


    【解决方案1】:

    在尝试重做这些东西时给未来的我的注意事项:

    1. 使用numpy/scipy有一些先决条件:g++gfortranblasatlaslapack
    2. 编译 numpy/scipy 源代码似乎更好——但也更费时间。 pip install 会这样做。

    命令是:

    sudo apt-get install g++ gfortran liblapack-dev libopenblas-dev python-dev python-pip

    sudo pip 安装鼻子

    sudo pip install numpy

    python -c "导入 numpy;numpy.test()"

    对于 scipy 库,以下工作:

    sudo pip install scipy

    python -c "导入 scipy;scipy.test()"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-28
      • 1970-01-01
      • 2016-08-26
      • 2014-04-12
      • 1970-01-01
      • 1970-01-01
      • 2022-10-05
      • 2017-02-11
      相关资源
      最近更新 更多