0

I am not expert in Ubuntu, so i need your help that will make my day. I have several versions of python on my machine because i'am working with odoo several odoo framewrok versions, after installing odoo 10 which works on Python 2.7. I am deleting it and i have this issue when reinstalling.

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main

How can i resolve that issue?

NOTE When i write type pip in terminal i get this location pip is /home/autoparts/.local/bin/pip. I thougt the pip location is not as the error above. Any help will be appricated.

Emmanuel Ban
  • 105
  • 9
Mohamed Fouad
  • 476
  • 9
  • 27

1 Answers1

1

Check out this topic on Github Pip 5447

They offered two ways as mentioned below:

We solved this issue by clear hash in bash:

$ hash -d pip

Or in dash (sh):

$ hash -r pip

Or

In this case, the particular issue seems to be:

  1. pip3 install --user --upgrade pip installs pip 10 in the user site, but doesn't uninstall the system site copy of pip.

  2. User runs the system wrapper from /usr/bin/pip3 which is from the OS-supplied pip 8. This wrapper expects to see pip 8, but it doesn't because user site takes priority over system site.

The solution is to use the pip wrapper installed when you installed pip 10 in --user. That will mean changing your PATH to put that first, or using an explicit path when you invoke pip.

furkanayd
  • 811
  • 7
  • 19