When pip suddenly stops working

Situation

  • After installing packages with pip, running pip install --upgrdae pip raises an Access is denied. error.
  • Running python -m pip install --upgrdae pip raises No module named pip.

01_get-pip install when pip suddenly stops working

Cause

pip install --upgrade pip uninstalls the existing pip and reinstalls it. If the reinstall step fails, the error above is printed.

Solution

Reinstall pip

  • Download get-pip.py, or copy the source from this link and create get-pip.py manually.
  • Run the get-pip.py file.
1
2
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

02_get-pip install when pip suddenly stops working