pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.55k stars 3.04k forks source link

exception error when ```pip3 list --outdated``` #6786

Closed kkdd closed 5 years ago

kkdd commented 5 years ago

Hello, I have encountered an exception error when executing pip3 list --outdated:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G8029
$ python3 --version
Python 3.7.4
$ pip3 --version
pip 19.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
$ cat `which pip3`
#!/usr/local/opt/python/bin/python3.7
# -*- coding: utf-8 -*-
import re
import sys

from pip._internal import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
$
$ pip3 list --outdated
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 188, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 156, in run
    packages = self.get_outdated(packages, options)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 164, in get_outdated
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 164, in <listcomp>
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 195, in iter_packages_latest_infos
    best_candidate = evaluator.get_best_candidate(all_candidates)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 729, in get_best_candidate
    best_candidate = max(candidates, key=self._sort_key)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/index.py", line 710, in _sort_key
    has_allowed_hash = int(link.is_hash_allowed(self._hashes))
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/models/link.py", line 213, in is_hash_allowed
    return hashes.is_hash_allowed(self.hash_name, hex_digest=self.hash)
AttributeError: 'NoneType' object has no attribute 'is_hash_allowed'
$
$ pip3 list
Package             Version    
------------------- -----------
aiohttp             3.5.4      
aiohttp-cors        0.7.0      
async-timeout       3.0.1      
attrs               19.1.0     
beautifulsoup4      4.8.0      
bokeh               1.3.0      
centerline          0.6.0      
certifi             2019.6.16  
chardet             3.0.4      
Click               7.0        
click-plugins       1.1.1      
cligj               0.5.0      
colorclass          2.2.0      
colorlog            4.0.2      
croniter            0.3.30     
cycler              0.10.0     
Cython              0.29.12    
decorator           4.4.0      
docopt              0.6.2      
EditorConfig        0.12.2     
faust               1.7.4      
Fiona               1.8.6      
Flask               1.1.1      
future              0.17.1     
GDAL                2.4.0      
geojson             2.4.1      
hjson               3.0.1      
idna                2.8        
imageio             2.5.0      
imageio-ffmpeg      0.3.0      
itsdangerous        1.1.0      
Jinja2              2.10.1     
joblib              0.13.2     
jsbeautifier        1.10.1     
kafka-python        1.4.6      
kiwisolver          1.1.0      
MarkupSafe          1.1.1      
matplotlib          3.1.1      
mode                4.0.1      
moviepy             1.0.0      
multidict           4.5.2      
munch               2.3.2      
mypy-extensions     0.4.1      
networkx            2.3        
nkf                 0.2.0      
nose                1.3.7      
numpy               1.16.4     
opentracing         2.2.0      
osmium              2.15.2     
packaging           19.0       
Pillow              6.1.0      
pip                 19.2       
proglog             0.1.9      
protobuf            3.7.1      
pybasicbayes        0.2.2      
pyhsmm              0.1.7      
pyparsing           2.4.1      
python-dateutil     2.8.0      
PyYAML              5.1.1      
requests            2.22.0     
requests-unixsocket 0.1.5      
robinhood-aiokafka  1.0.3      
Rtree               0.8.3      
scikit-learn        0.21.2     
scipy               1.3.0      
setuptools          41.0.1     
Shapely             1.6.4.post2
six                 1.12.0     
sklearn             0.0        
soupsieve           1.9.2      
terminaltables      3.1.0      
tornado             6.0.3      
tqdm                4.32.2     
urllib3             1.25.3     
venusian            1.2.0      
waitress            1.3.0      
Werkzeug            0.15.5     
wheel               0.33.4     
yarl                1.3.0      

Environment

Description

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.
xavfernandez commented 5 years ago

Hello, thanks for the report but this is a duplicate of #6772 and pip 19.2.1 should fix your issue.