18.04 has old version of pip and installing pip from pip creates a mess

Bug #1772746 reported by Richard Elkins
This bug affects 6 people
Affects Status Importance Assigned to Milestone
python-pip (Ubuntu)
Fix Released

Bug Description

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

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)

Revision history for this message
Richard Elkins (texadactyl) wrote :
Revision history for this message
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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in python-pip (Ubuntu):
status: New → Confirmed
Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
Cormac Long (clong150) wrote :

Any further moves on this?

I have an 18.04 LTS system which I got into a right tangle due to updating apt installed pip using
    pip install -U pip
(I needed pip > 10). It took some fussing to sort out (sadness).

Rolf Leggewie (r0lf)
summary: - After upgrade to 18.04, all pip and pip3 commands fail
+ 18.04 has old version of pip and installing pip from pip creates a mess
Revision history for this message
Richard Elkins (texadactyl) wrote :

I tried `pip3` again and it seems fine in *buntu 18.04.3.up-to-date.

I do not know about `pip` (Python 2). I no longer use Python 2 because it is deprecated.

Changed in python-pip (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.