In this post , we will see How To Fix - "Cannot import name 'main'" Error in Python. Sometimes while trying to install any package using pip, we get the the following import error:
ImportError: cannot import name 'main'
This mostly relates to the pip package manager . Probably the installed pip got upgraded in your system (Just FYI...Command to upgrade pip is -
sudo pip install pip --upgrade
$ which pip
$ which pip3
export PATH="${HOME}/.local/bin:$PATH"
sudo apt install python3-pip --reinstall
sudo python -m pip uninstall pip && sudo apt install python-pip --reinstall
Hope this helps to resolve the issue.