1

I've read Error after upgrading pip: cannot import name 'main' https://github.com/pypa/pip/issues/5240 https://github.com/pypa/pip/issues/5447

And others.

I've tried the suggested commands to recover pip. I've also removed and reinstalled pip in various ways multiple times with apt. I can't get the functionality back.

By functionality I mean that I want to be able to do a simple:

pip install matplotlib

I get this error:

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

What am I supposed to do?

I'm not a Python expert, I don't appreciate the implications of pip.main being moved to pip._internal.main, or if this is even the cause of my particular problem.

I'm on Debian 9.8.

I'm sure many others are facing this problem, regardless of how they ended up getting it. I believe I got it from upgrading pip as root.

What exactly should I do?

AlphaCentauri
  • 283
  • 5
  • 12

0 Answers0