我使用conda install hypothesis
在Anaconda上安装了假设,我在Spyder中使用Python 3.7。
在名为testing.py
的文件中,我编写了以下内容
from hypothesis import given
import hypothesis.strategies as st
但是当我运行该文件时,它会显示:
导入错误:没有名为“hypothesis”的模块
我应该怎么做来解决这个问题?
我使用conda install hypothesis
在Anaconda上安装了假设,我在Spyder中使用Python 3.7。
在名为testing.py
的文件中,我编写了以下内容
from hypothesis import given
import hypothesis.strategies as st
但是当我运行该文件时,它会显示:
导入错误:没有名为“hypothesis”的模块
我应该怎么做来解决这个问题?
使用Pip安装Hypothesis
pip install hypothesis
这将解决问题。
此外,0.2.2是开发人员确认的最佳稳定版本。
你不在项目目录中
cd to your file
通过运行测试进行测试
pytest
或者
python manage.py test