ImportError: No module named 'hypothesis'

Viewed 5003

I installed hypothesis on Anaconda with conda install hypothesis. I use Python 3.7 on Spyder.

In a file called testing.py I wrote

from hypothesis import given
import hypothesis.strategies as st

but when I run the file, it says:

ImportError: No module named 'hypothesis'

How can I do to fix this problem?

3 Answers

Install Hypothesis with Pip

pip install hypothesis

this will resolve the issue.

Also, 0.2.2 is the best stable version confirmed by the developers.

maybe you have 2 versions of python installed and when you try to install with pip it installs in another place while you try to use it in another version.

You're not in your project directory

   cd to your file

test by running test

   pytest 

or

   python manage.py test
Related