question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'NoneType' object has no attribute 'is_hash_allowed'

See original GitHub issue

Environment

  • pip version: 19.2
  • Python version: 3.6.8
  • OS: Mac OSX (Darwin Kernel Version 18.6.0)

Description I made env update in my project including pip as well. After that I wanted to check outdated packages with command:

pip list --outdated --format=columns

After that exception was raised.

Expected behavior I expected list of packages or empty list.

How to Reproduce

  1. Get the newest version of package from PyPI.
  2. Then run pip list --outdated --format=columns
  3. An error occurs.

Output

(env) project (develop) $ pip list --outdated --format=columns
ERROR: Exception:
Traceback (most recent call last):
  File "/project/env/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 188, in main
    status = self.run(options, args)
  File "/project/env/lib/python3.6/site-packages/pip/_internal/commands/list.py", line 156, in run
    packages = self.get_outdated(packages, options)
  File "/project/env/lib/python3.6/site-packages/pip/_internal/commands/list.py", line 164, in get_outdated
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "/project/env/lib/python3.6/site-packages/pip/_internal/commands/list.py", line 164, in <listcomp>
    dist for dist in self.iter_packages_latest_infos(packages, options)
  File "/project/env/lib/python3.6/site-packages/pip/_internal/commands/list.py", line 195, in iter_packages_latest_infos
    best_candidate = evaluator.get_best_candidate(all_candidates)
  File "/project/env/lib/python3.6/site-packages/pip/_internal/index.py", line 729, in get_best_candidate
    best_candidate = max(candidates, key=self._sort_key)
  File "/project/env/lib/python3.6/site-packages/pip/_internal/index.py", line 710, in _sort_key
    has_allowed_hash = int(link.is_hash_allowed(self._hashes))
  File "/project/env/lib/python3.6/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'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:40
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

8reactions
pradyunsgcommented, Jul 23, 2019

The fix is in master. I’ll do the release in a bit – getting a bit of rest after a long day today.

6reactions
pradyunsgcommented, Jul 23, 2019

The release with this bug-fix has been uploaded. Thanks everyone (and especially @cjerdonek)! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get AttributeError: 'NoneType' object has no attribute ...
NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None .
Read more >
AttributeError: 'NoneType' object has no attribute 'version_tuple
On CS9 pipeline, Container Build and Image build jobs are failing with following errors: ``` TASK [oooci-build-images : Create temp venv w/ ...
Read more >
Attribute error:'NoneType' object has no attribute
spatialReference.Name >>> print dsc. i'm getting following error at line 5. Attributeerror:'NoneType' object has no attribute Name.
Read more >
AttributeError: 'NoneType' object has no attribute 'ema_scope'
AttributeError : 'NoneType' object has no attribute 'ema_scope'. I have the Automatic1111 webui do a git pull everytime I run it.
Read more >
AttributeError: 'NoneType' object has no attribute 'getReleases'
Hi there, I am currently trying to get my experiment to integrate with our Biopac shock hardware via parallel port. I am running...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found