ImportError: No module named 'urllib3'

6.9k views Asked by At

Everytime I use pip command the command failed with error: "ImportError: No module named 'urllib3'". I do got urllib3 installed, and when I'm trying to install urllib3 again I got the same error. What can I do?

I'm using windows 10.

I cant run "pip install virtualenv", I got the same error with any pip command.

4

There are 4 answers

0
Ariful Shuvo On

For escaping this error try to install virtualenv through "pip install virtualenv" and create the virtual environment directory using "python3 -m venv myvenv" which will create a myvenv named folder now activate the myvenv folder using "source \myvenv\bin\activate" now you have your virtual environment setup now you can install whatever you want under the venv , which will not conflict with your base os installed programs try some googling to explore pic virtualenv setup and use. happy coding :)

0
Ian Stapleton Cordasco On

You probably need to bootstrap your installation of pip so that you can move along with this.

  1. Download the bootstrap script from https://bootstrap.pypa.io/get-pip.py
  2. Using whatever version of Python you wish, run it, e.g.,

    C:\\Python35.exe get-pip.py
    

After that finishes you should be able to pip install whatever you'd like.

0
richin On

I solved this issue by deinstalling python and reinstall it.

Then you can run

python -m pip install --upgrade pip

to get the latest version of pip

0
TRx Studio On

May be worth double checking your PYTHONPATH Environment Variable in: Control Panel\System and Security\System -> Advanced System Settings -> Environment Variables. I had a rogue copy of Python that caused this exact error