I wrote a script to do some IP address analysis from an imported CSV and it will not run with urllib3. I have tired uninstalling and reinstalling the module and even set up an new virtualenv. I get the following error message despite the module being shown below as imported:
(ENV) foo@Servername:~$ sudo python IP_Analysis_CSV.py
Traceback (most recent call last):
File "IP_Analysis_CSV.py", line 4, in <module>
import urllib3
ImportError: No module named urllib3
(ENV) foo@Servername:~$ pip freeze
certifi==2019.9.11
chardet==3.0.4
DateTime==4.3
idna==2.8
pytz==2019.3
requests==2.22.0
urllib3==1.25.6
zope.interface==4.6.0```
Credit to wim:
Running the script as sudo invokes the root python runtime where urllib3 is not installed. Where as running under your normal user account invokes the runtime where urllib3 is installed.