pip show fails silently if package not found · Issue #6858 · pypa/pip (original) (raw)
Environment
All
- pip version:
Up to 19.2.1 - Python version:
All - OS:
All
Description
When you use pip show
somepackage if somepackage is not found there is no output, this is not too bad when a single package is specified but when multiple ones are it is easy to fail to notice that one or more is missing. This was raised as a part of #5454 where trailing commas result in packages not being found.
Expected behavior
I would expect pip show
to give a clear indication of any package_(s)_ that it does not find, preferably either at the begining or end of output where it is less likely to be missed as mentioned by @chrahunt in his comments on #5454 - some thing like:
The following package(s) are not installed: somepackage
How to Reproduce
type: pip show asdf asdfasdf gsdfgfg dfgd
or any other random set of gibberish then try with 3 packages that you do have installed and one that you don't.
- type:
pip show asdf asdfasdf gsdfgfg dfgd
or any other random set of gibberish - Then run
pip show
with some packages that you have and one that you don't or gibberish
Output
> python -mpip show asdf asdfasdf gsdfgfg dfgd
> python -mpip show asdf requests requests-html
Name: requests
Version: 2.21.0
Summary: Python HTTP for Humans.
Home-page: http://python-requests.org
Author: Kenneth Reitz
Author-email: me@kennethreitz.org
License: Apache 2.0
Location: c:\python36_64\lib\site-packages
Requires: idna, chardet, certifi, urllib3
Required-by: yampy2, wikipedia, Sphinx, safety, requests-html, pypistats, plotly, pandas-datareader, osmnx, nbdime, moviepy, jupyterhub, jupyter-request
s, folium, cookiecutter, caniusepython3
---
Name: requests-html
Version: 0.10.0
Summary: HTML Parsing for Humans.
Home-page: https://github.com/kennethreitz/requests-html
Author: Kenneth Reitz
Author-email: me@kennethreitz.org
License: MIT
Location: c:\python36_64\lib\site-packagesRequires: pyppeteer, bs4, w3lib, requests, pyquery, fake-useragent, parseRequired-by:
Trying to spot the missing asdf
in the above is not simple.
I agree with the sentiment that "Errors should never pass silently." and think that this is a case in point.
In the spirit of "Unless explicitly silenced." -q
could suppress this message.