Medium Feed

 

Sunday, June 18, 2017

AttributeError: '_NamespacePath' object has no attribute 'sort' - Python PIP

I was facing an error while using PIP install command. It was working well and suddenly throwing error "AttributeError: '_NamespacePath' object has no attribute 'sort' ".

None of PIP command did not work at all and sensed to me PIP package broken.

Finally, Reinstalling pip packages helped me to resolve the error. steps to reinstall

git clone https://github.com/pypa/pip.git
cd pip
python setup.py install
Update : Even after I reinstall PIP, the issues was occurring randomly. Finally came to know the permanent fix for the issue, problem was the Python version I had in my machine. I updated my python version from 3.6.1 to 3.6.2 and thereafter this issue did NOT occur.