> Any idea how can I fix above error? After looking for it on the Internet, I found this[1] bug report on Launchpad issue tracker. It happens because pip didn't catch exceptions in index.py, consistently (see spitfire1900's[2] comment) and has fixed in pip v19.1+[3].
[1]: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1835686 [2]: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1835686/comments/3 [3]: https://github.com/pypa/pip/issues/6428#issuecomment-501826842