After upgrade to 18.04, all pip and pip3 commands fail

Bug #1772746 reported by Richard Elkins on 2018-05-22
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
python-pip (Ubuntu)
Undecided
Unassigned

Bug Description

Both pip and pip3 seem to be broken in 18.04.
So, this bug report applies to python3-pip too.

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

Work-around: export PATH="${HOME}/.local/bin:$PATH"
After applying this work-around, both pip and pip3 work as expected i.e. before my upgrade from 17.10 to 18.04.

Note that I keep my Python 2 and 3 packages under $HOME/.local in case that is relevant.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: python-pip 9.0.1-2
ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
Uname: Linux 4.15.0-20-generic x86_64
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue May 22 15:46:35 2018
InstallationDate: Installed on 2017-10-13 (221 days ago)
InstallationMedia: Xubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170926)
PackageArchitecture: all
SourcePackage: python-pip
UpgradeStatus: Upgraded to bionic on 2018-05-18 (4 days ago)

Richard Elkins (texadactyl) wrote :
Richard Elkins (texadactyl) wrote :

Another verified work-around that needs no alteration to the PATH:
1. sudo apt-get purge python-pip python3-pip
2. Delete all of the pip/pip3 stuff under .local including the packages.
3. sudo apt-get install python-pip python3-pip
4. Using pip and/or pip3, reinstall needed Python packages.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-pip (Ubuntu):
status: New → Confirmed
Andrius Merkys (andriusmerkys) wrote :

It seems that pip was updated using 'pip install -U pip', what made user- and system-wide installations of pip out-of-sync. It should be noted, however, that pip can only be updated using APT, as updating via pip itself risks breaking the package. It might be wise to implement a big warning upon issuing 'pip install -U pip'.

Will forward this to Debian.

chrisbrousseau (chrisbrousseau) wrote :

From https://packages.ubuntu.com/bionic/python3-pip it seems like pip is pinned at an old version python3-pip (9.0.1-2).

If the current version of pip3 (18.1) were added to the Universe repo, people would not attempt these workarounds that cause problems with apt installed pip3.

pip has some important improvements (changelog here: https://pip.pypa.io/en/stable/news/) Pip maintainers have moved to a new numbering scheme mirroring Ubuntuv; so from v9 which is in bionic to v18 now.

We've got python 3.7 in the Universe repo - are there reasons we should not upgrade pip in the source?

Andrius Merkys (andriusmerkys) wrote :

There are movements on the Debian side to update to v18. The packaging is complicated, I did what I could to push it, however I got stuck at some point with debundling and turned to package maintainers for help.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers