ImportError: cannot import name main when running pip on Ubuntu

On Ubuntu Server, I have the same problem with python27. Try this:

Open usr/bin/pip in your favorite editor And

Change

from pip import main
if __name__ == '__main__':
    sys.exit(main())

To

from pip._internal import main
if __name__ == '__main__':
    sys.exit(main())

Try after that and your issue will be gone.

:)