Python requests ImportError: cannot import name HeaderParsingError
requests
comes with its own copy of the urllib3
library, in the requests/packages
subdirectory. It is this copy that is somehow broken.
Reinstall requests
itself; either upgrade (you have at most version 2.1.0, given the from .packages import charade as chardet
line), or reinstall the existing version.
Reinstalling with pip
can be done with the --force-reinstall
switch:
pip install --force-reinstall requests==2.1.0
or force an upgrade:
pip install --upgrade requests
I had the same issue while I was simply trying to make any command using pip. At the end I found a very simple solution, just use sudo before pip.
Specifically for above issue, I have used following command.
sudo pip install --upgrade urllib3
Hope that will help.