Whenever I am trying to install any package using pip, I am getting this import error:
dey@niroj-notebook:~$ pip3 install numpy
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
dey@niroj-notebook:~$ cat `which pip3`
#!/usr/bin/python3
# GENERATED BY DEBIAN
import sys
# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import main
if __name__ == '__main__':
sys.exit(main())
It was working fine earlier, I am not sure why it is throwing this error.
How to fix this error?