I used easy_install to install pytest on a mac and started writing tests for a project with a file structure likes so:
repo/ repo/app.py repo/settings.py rep
I had a similar issue. pytest did not recognize a module installed in the environment I was working in.
pytest
I resolved it by also installing pytest into the same environment.