4

I'm running py.tests from a virtual env. getting

ImportError: No module named responses

after pip freeze i see responses are installed

pip freeze                                                   ✱
cookies==2.2.1
funcsigs==1.0.2
mock==2.0.0
pbr==1.10.0
py==1.4.31
pymongo==2.7.2
pytest==2.9.2
requests==2.10.0
responses==0.5.1
six==1.10.0

Running tests :

like so py.test --verbose tests/
Ohad Perry
  • 1,315
  • 2
  • 15
  • 26
  • what does pip3 freeze say? – user2393256 Jul 14 '16 at 12:25
  • pip3 freeze ✱ Flask==0.10.1 Jinja2==2.7.3 MarkupSafe==0.23 SQLAlchemy==0.9.8 cookies==2.2.1 itsdangerous==0.24 mimerender==0.5.4 pbr==0.10.7 pipdeptree==0.4.2 pymongo==2.7.2 python-dateutil==2.4.0 python-mimeparse==0.1.4 requests==2.5.1 responses==0.5.1 six==1.9.0 stevedore==1.2.0 virtualenv==12.0.5 virtualenv-clone==0.2.5 virtualenvwrapper==4.3.2 – Ohad Perry Jul 14 '16 at 12:26
  • I'm having the same issue, but I'm using nose in my django project. – Adiyat Mubarak Oct 22 '18 at 09:29

1 Answers1

0

I suppose this arises from the error when installing responses:

ERROR: responses 0.12.1 has requirement urllib3>=1.25.10, but you'll have urllib3 1.22 which is incompatible.

If you do update urllib3 you get this error:

ERROR: requests 2.18.4 has requirement urllib3<1.23,>=1.21.1, but you'll have urllib3 1.26.2 which is incompatible.

Yet another reason to move to httpx

So what you can do is install the older responses version:

responses<0.10.8
tread
  • 10,133
  • 17
  • 95
  • 170