Dependency to six library
See original GitHub issueImagehash 4.3.0 tries to import six, but it is not declared as a dependency for Python 3.10:
https://github.com/osmlab/editor-layer-index/actions/runs/3120554190/jobs/5061223939 https://github.com/osmlab/editor-layer-index/blob/gh-pages/requirements.txt
Traceback (most recent call last):
File "/home/runner/work/editor-layer-index/editor-layer-index/scripts/sync_wms.py", line 28, in <module>
import imagehash
File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/imagehash/__init__.py", line 155, in <module>
from six.moves.collections_abc import Callable
ModuleNotFoundError: No module named 'six'
Error: Process completed with exit code 1.
There seems to be a fix already in master, but I’m not sure if this works in all cases. I would suggest something like this (not tested):
# not sure when typing.Callable was first introduced. Maybe 3.5?, But I'm not sure if such old python version are still supported by ImageHash
if sys.version_info >= (3, 6):
# https://stackoverflow.com/questions/65858528/is-collections-abc-callable-bugged-in-python-3-9-1
if sys.version_info > (3, 9, 1):
from collections.abc import Callable
else:
from typing import Callable
try:
MeanFunc = Callable[[NDArray], float]
HashFunc = Callable[[Image.Image], ImageHash]
except TypeError:
MeanFunc = Callable # type: ignore
HashFunc = Callable # type: ignore
Issue Analytics
- State:
- Created a year ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
six · PyPI
Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with...
Read more >Six: Python 2 and 3 Compatibility Library — six 1.15.0 ...
Six provides simple utilities for wrapping over differences between Python 2 and Python 3. It is intended to support codebases that work on...
Read more >six-1.11.0 (Python Module) - Linux From Scratch!
Introduction to Six Module Six is a Python 2 and 3 compatibility library. This package is known to build and work properly using...
Read more >benjaminp/six: Python 2 and 3 compatibility library - GitHub
Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with...
Read more >six - Python Package Health Analysis - Snyk
Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I made a release, 4.3.1. Can you please test whether it works for you?
OK, please reopen if it is still an issue.
I am aware. I might drop it once things really start to break, but it’s not that bad atm.