pip3 installation does not give expected result

Bug #1779564 reported by Christopher Barrington-Leigh
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Invalid
Undecided
Unassigned
python-pip (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

To a naive user (like me) the following should not happen. I get a suggestion to install an already-installed package. ie, installing the package does not make a difference:

 [~/]$ pip3
 The program 'pip3' is currently not installed. You can install it by
 typing:
 sudo apt install python3-pip
 [~/]$ sudo apt install python3-pip
 wipe your finger across the fingerprint reader
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 python3-pip is already the newest version (9.0.1-2).
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: python3-pip 9.0.1-2
ProcVersionSignature: Ubuntu 4.13.0-45.50-generic 4.13.16
Uname: Linux 4.13.0-45-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.9
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Jul 1 12:09:42 2018
EcryptfsInUse: Yes
InstallationDate: Installed on 2017-11-18 (225 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
PackageArchitecture: all
SourcePackage: python-pip
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :
description: updated
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting.

The package suggestion comes from the command-not-found package, but I'm not quite sure which is at fault here. (Especially since I am not able to reproduce the issue on my 17.10 system, pip3 runs as expected after installing)

Could you please post the output of the following commands:
1. dpkg -L python3-pip (tells us which files are installed by the package, which should include the pip3 binary)
2. apt policy python3-pip (just to double-check, the version number looks ok from the apport information in the summary)
3. echo $PATH (in case it can't find the binary to run in your PATH, although this sounds a bit unlikely)

Changed in python-pip (Ubuntu):
status: New → Incomplete
Changed in command-not-found (Ubuntu):
status: New → Incomplete
Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :
Download full text (4.6 KiB)

$ dpkg -L python3-pip
/.
/usr
/usr/bin
/usr/bin/pip3
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/pip
/usr/lib/python3/dist-packages/pip/__init__.py
/usr/lib/python3/dist-packages/pip/__main__.py
/usr/lib/python3/dist-packages/pip/_vendor
/usr/lib/python3/dist-packages/pip/_vendor/__init__.py
/usr/lib/python3/dist-packages/pip/basecommand.py
/usr/lib/python3/dist-packages/pip/baseparser.py
/usr/lib/python3/dist-packages/pip/cmdoptions.py
/usr/lib/python3/dist-packages/pip/commands
/usr/lib/python3/dist-packages/pip/commands/__init__.py
/usr/lib/python3/dist-packages/pip/commands/check.py
/usr/lib/python3/dist-packages/pip/commands/completion.py
/usr/lib/python3/dist-packages/pip/commands/download.py
/usr/lib/python3/dist-packages/pip/commands/freeze.py
/usr/lib/python3/dist-packages/pip/commands/hash.py
/usr/lib/python3/dist-packages/pip/commands/help.py
/usr/lib/python3/dist-packages/pip/commands/install.py
/usr/lib/python3/dist-packages/pip/commands/list.py
/usr/lib/python3/dist-packages/pip/commands/search.py
/usr/lib/python3/dist-packages/pip/commands/show.py
/usr/lib/python3/dist-packages/pip/commands/uninstall.py
/usr/lib/python3/dist-packages/pip/commands/wheel.py
/usr/lib/python3/dist-packages/pip/compat
/usr/lib/python3/dist-packages/pip/compat/__init__.py
/usr/lib/python3/dist-packages/pip/compat/dictconfig.py
/usr/lib/python3/dist-packages/pip/download.py
/usr/lib/python3/dist-packages/pip/exceptions.py
/usr/lib/python3/dist-packages/pip/index.py
/usr/lib/python3/dist-packages/pip/locations.py
/usr/lib/python3/dist-packages/pip/models
/usr/lib/python3/dist-packages/pip/models/__init__.py
/usr/lib/python3/dist-packages/pip/models/index.py
/usr/lib/python3/dist-packages/pip/operations
/usr/lib/python3/dist-packages/pip/operations/__init__.py
/usr/lib/python3/dist-packages/pip/operations/check.py
/usr/lib/python3/dist-packages/pip/operations/freeze.py
/usr/lib/python3/dist-packages/pip/pep425tags.py
/usr/lib/python3/dist-packages/pip/req
/usr/lib/python3/dist-packages/pip/req/__init__.py
/usr/lib/python3/dist-packages/pip/req/req_file.py
/usr/lib/python3/dist-packages/pip/req/req_install.py
/usr/lib/python3/dist-packages/pip/req/req_set.py
/usr/lib/python3/dist-packages/pip/req/req_uninstall.py
/usr/lib/python3/dist-packages/pip/status_codes.py
/usr/lib/python3/dist-packages/pip/utils
/usr/lib/python3/dist-packages/pip/utils/__init__.py
/usr/lib/python3/dist-packages/pip/utils/appdirs.py
/usr/lib/python3/dist-packages/pip/utils/build.py
/usr/lib/python3/dist-packages/pip/utils/deprecation.py
/usr/lib/python3/dist-packages/pip/utils/encoding.py
/usr/lib/python3/dist-packages/pip/utils/filesystem.py
/usr/lib/python3/dist-packages/pip/utils/glibc.py
/usr/lib/python3/dist-packages/pip/utils/hashes.py
/usr/lib/python3/dist-packages/pip/utils/logging.py
/usr/lib/python3/dist-packages/pip/utils/outdated.py
/usr/lib/python3/dist-packages/pip/utils/packaging.py
/usr/lib/python3/dist-packages/pip/utils/setuptools_build.py
/usr/lib/python3/dist-packages/pip/utils/ui.py
/usr/lib/python3/dist-packages/pip/vcs
/usr/lib/python3/dist-packages/pip/vcs/__init__.py
/usr/lib/python3/dist-packages/pip/vcs/bazaar....

Read more...

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for providing the requested information. I'm stumped as to why this happens though.

While you have some additions to your PATH, that shouldn't "hide" binaries like that. And /usr/bin is part of the PATH so when it picks up python3 it should also find pip3. (I assume python3 runs as expected).

Are you able to run it, when specifying the full path i.e. /usr/bin/pip3 ?

Changed in python-pip (Ubuntu):
status: Incomplete → New
Changed in command-not-found (Ubuntu):
status: Incomplete → New
Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote : Re: [Bug 1779564] Re: pip3 installation does not give expected result

No, it's not there:

$/usr/bin/pip3
bash: /usr/bin/pip3: No such file or directory

The only thing I can do (and have been doing) is python3 -m pip

though maybe that is not even the right thing to be doing.

Python3 works. I just checked the original symptoms, and they are the same.

On Sat, Jul 7, 2018 at 10:40 AM, Hans Joachim Desserud <
<email address hidden>> wrote:

> Thanks for providing the requested information. I'm stumped as to why
> this happens though.
>
> While you have some additions to your PATH, that shouldn't "hide"
> binaries like that. And /usr/bin is part of the PATH so when it picks up
> python3 it should also find pip3. (I assume python3 runs as expected).
>
> Are you able to run it, when specifying the full path i.e. /usr/bin/pip3
> ?
>
> ** Changed in: python-pip (Ubuntu)
> Status: Incomplete => New
>
> ** Changed in: command-not-found (Ubuntu)
> Status: Incomplete => New
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1779564
>
> Title:
> pip3 installation does not give expected result
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/command-not-found/+bug/1779564/+
> subscriptions
>

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>No, it's not there:

Based on the file list for python3-pip it should be. :/ Could you check (and compare) `ls -la /usr/bin/pip3` and `sudo ls -la /usr/bin/pip3`, to see if there's some permission issue or if the binary is completely missing.

I suppose a reinstall of python3-pip might fix the issue if the binary has somehow been removed, but that doesn't explain what caused the issue.

Revision history for this message
Christopher Barrington-Leigh (cpbl) wrote :

Hi. sudo got the same result: the pip3 binary was not there.

apt remove followed by apt install did fix the problem. Sorry I did not try that earlier. I do not know what could have been the problem. If my apt log history could be helpful, we can keep digging. Otherwise, I will understand if there are more important things for you to work on.

Thanks!

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

>apt remove followed by apt install did fix the problem. Sorry I did not try that earlier. I do not know what could have been the problem.

I don't know either. I suspect that "something" deleted the binary, but I wouldn't really know where to look to figure out what. So unless this happened really recently, I think it will be a needle in the haystack to find something in the apt logs.

I'm closing this for now, based on your latest comment. If you do happen to find out the underlying cause, please report a new bug for this.

Changed in python-pip (Ubuntu):
status: New → Invalid
Changed in command-not-found (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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