Cannot import name main


I got this error when I tried running pip:

    from pip import main
ImportError: cannot import name 'main'


I had installed pip from Ubuntu repositories using this command:

$ sudo apt install python-pip

However, I had previously used a pip from Anaconda on this computer. Though I had uninstalled it, it looked like it had left some files that were affecting how the Ubuntu pip worked.

I found the ~/.local/bin and ~/.local/lib directories that Anaconda pip had created and deleted those directories. Ubuntu pip worked fine after that.

Tried with: Ubuntu 16.04

One thought on “Cannot import name main

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.