首页 > 解决方案 > ImportError:没有名为“假设”的模块

问题描述

我在 Anaconda 上安装了假设conda install hypothesis。我在 Spyder 上使用 Python 3.7。

在一个名为testing.py我写的文件中

from hypothesis import given
import hypothesis.strategies as st

但是当我运行文件时,它说:

ImportError:没有名为“假设”的模块

我该如何解决这个问题?

标签: pythonimport

解决方案


使用 Pip 安装假设

pip install hypothesis

这将解决问题。

此外,0.2.2 是开发人员确认的最佳稳定版本。


推荐阅读