I wrote a script to call an API and ran it successfully last week. This week, it won’t run. I get back the following error message:
Traceback (most recent call last): File "user_audit.py", line 2, in <module> import requests File "c:\Python27\lib\site-packages\requests\__init__.py", line 60, in <module> from .packages.urllib3.exceptions import DependencyWarning File "c:\Python27\lib\site-packages\requests\packages\__init__.py", line 29, in <module> import urllib3 ImportError: No module named urllib3
I’ve confirmed that packages is up to date, tried uninstalling and reinstalling it, but nothing has worked so far. Can someone help?
I installed urllib3 as suggested by @MSHossain, but then got another error message. The new message referenced another file that I’d written, which had created a Python compiled file. The other file was using smptlib to attempt to send an email. I don’t understand how this would happen, but I deleted the other file and my script ran without any problems. I’ve accepted the answer below as I was able to pip install urllib3, but it should have already been included in the requests module.