尝试首次运行pytest时出错

时间:2019-04-06 15:10:47

标签: python python-3.x numpy anaconda pytest

我正在尝试学习如何使用pytest,当我执行pytest test_map_func.py(文件名)时,出现以下错误:

Traceback (most recent call last):
  File "c:\users\coult\anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
ImportError: DLL load failed: couldn't find the specified module (translated from spanish)

然后,我得到了很多包含目录的列表,以及以下这段代码:

ImportError:
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: DLL load failed: couldn't find the specified module (translated from spanish)

感谢所有可以帮助我的人:-)

1 个答案:

答案 0 :(得分:0)

我刚刚执行了以下操作,并且有效(解决方案100%菜鸟):

pip卸载numpy 点安装numpy

然后我再次运行测试文件,然后运行TACHAN!它起作用了:D