question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install --upgrade pip breaks pip, still

See original GitHub issue

Environment

  • pip version: 10
  • Python version: 2.7.12
  • OS: Ubuntu 16.04

Description

I ran “pip install --upgrade pip”

now pip breaks, every time:

[J]~/bin >pip --version Traceback (most recent call last): File “/usr/bin/pip”, line 9, in <module> from pip import main ImportError: cannot import name main

I tried “sudo apt remove python-pip” and a full autoremove, and re-installed pip, and it’s still broken

Another ticket, from April 16 is now closed, relates to the same error message https://github.com/pypa/pip/issues/5240

How do we downgrade or fix this?

Expected behavior

How to Reproduce

  1. Get package from ‘…’
  2. Then run ‘…’
  3. An error occurs.

Output

Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
benoit-pierrecommented, May 22, 2018

You probably don’t have the directory where the new pip is installed in your PATH. I think one of Ubuntu/Debian patches to pip is to install to /usr/local per default (when run as root, and without --user). Do you have a pip in /usr/local/bin?

0reactions
lock[bot]commented, May 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip broken after upgrade. Cannot unsinstall ... - Stack Overflow
1 You are using pip version 8.1.1, however version 22.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command....
Read more >
How to upgrade your pip package to the latest version
Pip is a useful tool for managing and installing python packages. Here's how to upgrade it on various operating systems.
Read more >
How to Update All Python Packages - ActiveState
Update all Python Packages on Windows · Open a command shell by typing 'powershell' in the Search Box of the Task bar ·...
Read more >
How to Upgrade Pip on Mac, Windows, and Linux - AppDividend
To upgrade pip on mac, you can use the sudo pip install --upgrade pip command. You can also upgrade Python to get the...
Read more >
How To Use Pip (Simple Guide To Install, Update, Uninstall ...
Redistributors typically remove the ensurepip module from the Python install. If you are using a modified version of Python, you can install pip...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found