It is possible that either urllib3 is not imported or not installed.
Simply write import urllib3 at the top of the file to install write pip install urllib3 into the terminal. You may not activate the environment variable correctly. To activate the environment variable, write source env/bin/activate into the terminal. Here env is environment variable name.
Hope this helps!