AttributeError: type object 'Callable' has no attribute '_abc_registry'
ouening opened this issue · 3 comments
Hi, when I try to install imgviz in Win10 64bit (python3.7), I got errors:
ERROR: Command errored out with exit status 1:
command: 'E:\Applications\WPy64-3741\python-3.7.4.amd64\python.exe' 'E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'D:\temp\Temp\pip-build-env-3ixr8qgd\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.tuna.tsinghua.edu.cn/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (42 lines):
Traceback (most recent call last):
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\__main__.py", line 26, in <module>
sys.exit(_main())
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_internal\commands\install.py", line 17, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_internal\cli\req_command.py", line 16, in <module>
from pip._internal.index.collector import LinkCollector
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_internal\index\collector.py", line 14, in from pip._vendor import html5lib, requests
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_vendor\requests\__init__.py", line 125, in <module>
from . import utils
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_vendor\requests\utils.py", line 25, in <module>
from . import certs
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_vendor\requests\certs.py", line 15, in <module>
from pip._vendor.certifi import where
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_vendor\certifi\__init__.py", line 1, in <module>
from .core import contents, where
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip\_vendor\certifi\core.py", line 12, in <module>
from importlib.resources import path as get_path, read_text
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\importlib\resources.py", line 11, in <module>
from typing import Iterable, Iterator, Optional, Set, Union # noqa: F401
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
----------------------------------------
ERROR: Command errored out with exit status 1: 'E:\Applications\WPy64-3741\python-3.7.4.amd64\python.exe' 'E:\Applications\WPy64-3741\python-3.7.4.amd64\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'D:\temp\Temp\pip-build-env-3ixr8qgd\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.tuna.tsinghua.edu.cn/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
How can I solve it?
bumping into this with dockerfile
https://github.com/johndpope/dockerfiles/blob/main/deepfacelab/Dockerfile
Collecting labelme
Downloading labelme-4.5.6.tar.gz (1.5 MB)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.8/dist-packages (from labelme) (3.3.2)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from labelme) (1.17.3)
Requirement already satisfied: Pillow>=2.8.0 in /usr/local/lib/python3.8/dist-packages (from labelme) (6.2.1)
Requirement already satisfied: PyYAML in /usr/local/lib/python3.8/dist-packages (from labelme) (5.3.1)
Requirement already satisfied: termcolor in /usr/local/lib/python3.8/dist-packages (from labelme) (1.1.0)
Collecting imgviz>=0.11.0
Downloading imgviz-1.2.3.tar.gz (7.7 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/local/lib/python3.8/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-wfv6_5c2/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (42 lines):
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.8/dist-packages/pip/__main__.py", line 26, in <module>
sys.exit(_main())
File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/local/lib/python3.8/dist-packages/pip/_internal/commands/__init__.py", line 105, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/dist-packages/pip/_internal/commands/install.py", line 17, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/usr/local/lib/python3.8/dist-packages/pip/_internal/cli/req_command.py", line 18, in <module>
from pip._internal.index.collector import LinkCollector
File "/usr/local/lib/python3.8/dist-packages/pip/_internal/index/collector.py", line 14, in <module>
from pip._vendor import html5lib, requests
File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/requests/__init__.py", line 125, in <module>
from . import utils
File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/requests/utils.py", line 25, in <module>
from . import certs
File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/requests/certs.py", line 15, in <module>
from pip._vendor.certifi import where
File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/certifi/__init__.py", line 1, in <module>
from .core import contents, where
File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/certifi/core.py", line 12, in <module>
from importlib.resources import path as get_path, read_text
File "/usr/lib/python3.8/importlib/resources.py", line 11, in <module>
from typing import Iterable, Iterator, Optional, Set, Union # noqa: F401
File "/usr/local/lib/python3.8/dist-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/usr/local/lib/python3.8/dist-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.8/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-wfv6_5c2/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
Seems this is a known issue in newer Python than 3.6.
https://stackoverflow.com/questions/55833509/attributeerror-type-object-callable-has-no-attribute-abc-registry
Generating dataset from: /Users/kanikshasharma/Downloads/labelme-master/examples/semantic_segmentation/Train/32 copy.json
This JSON file (/Users/kanikshasharma/Downloads/labelme-master/examples/semantic_segmentation/Train/32 copy.json) may be incompatible with current labelme. version in file: 4.5.12, current version: 5.1.0
Traceback (most recent call last):
File "/Users/kanikshasharma/Downloads/labelme-master/examples/semantic_segmentation/labelme2voc.py", line 105, in
main()
File "/Users/kanikshasharma/Downloads/labelme-master/examples/semantic_segmentation/labelme2voc.py", line 96, in main
imgviz.rgb2gray(img),
File "/Users/kanikshasharma/opt/anaconda3/lib/python3.8/site-packages/imgviz/color.py", line 23, in rgb2gray
assert rgb.shape[2] == 3, "rgb shape must be (H, W, 3)"
AssertionError: rgb shape must be (H, W, 3)