我在numpy中有两个单元测试错误,我似乎无法破译: 我正在运行Ubuntu 16.4
> Running unit tests for numpy
NumPy version 1.11.0
NumPy relaxed strides checking option: False
NumPy is installed in /usr/lib/python2.7/dist-packages/numpy
Python version 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
nose version 1.3.
然后错误是:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib/python2.7/dist-packages/numpy/core/tests/test_indexing.py", line 17, in <module>
cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray.__file__)
File "/usr/lib/python2.7/dist-packages/numpy/ctypeslib.py", line 163, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension
=============================================== =======================
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/usr/lib/python2.7/dist-packages/numpy/tests/test_ctypeslib.py", line 11, in <module>
cdll = load_library('multiarray', np.core.multiarray.__file__)
File "/usr/lib/python2.7/dist-packages/numpy/ctypeslib.py", line 163, in load_library
raise OSError("no file with expected extension")
OSError: no file with expected extension
有没有人知道可能出现什么问题?
答案 0 :(得分:1)
我为numpy 1.11.0和Ubuntu 16.04发生了完全相同的错误。我将numpy升级到最新的[sudo] pip install --upgrade numpy
,然后测试工作。