Numpy test()完成了错误

时间:2014-01-19 18:31:02

标签: python-2.7 ubuntu numpy

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

  

失败:test_pareto(test_random.TestRandomDist)

     

追踪(最近一次通话):     在test_pareto中输入文件“/usr/lib/python2.7/dist-packages/numpy/random/tests/test_random.py”,第313行       np.testing.assert_array_almost_equal(actual,desired,decimal = 15)     在assert_array_almost_equal中输入文件“/usr/lib/python2.7/dist-packages/numpy/testing/utils.py”,第800行       header =('数组不等于%d小数'%decimal))     在assert_array_compare中输入文件“/usr/lib/python2.7/dist-packages/numpy/testing/utils.py”,第636行       提出AssertionError(msg)   Asse田:   数组不等于15位小数

     

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

     
     

在17.483s中进行了3169次测试

     

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

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

感谢。

1 个答案:

答案 0 :(得分:5)

未来我的注意事项,当我试图重做这些东西时:

  1. 使用numpy / scipy:[{1}} g++ gfortran blas atlas有一些先决条件。
  2. 编译numpy / scipy源似乎更好 - 也更耗时。 pip install就是这样做的。
  3. 命令是:

      

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

         

    sudo pip install nose

         

    sudo pip install numpy

         

    python -c“import numpy; numpy.test()”

    对于scipy库,以下工作:

      

    sudo pip install scipy

         

    python -c“import scipy; scipy.test()”