此问题已在此处有答案:
AttributeError: type object 'Callable' has no attribute '_abc_registry'(1个答案)
2天前关闭。
我按照安装说明安装了mmdetection。现在我想使用Cityscapes数据集并训练模型。MMdetector的安装工作正常,演示也正常运行。当我想安装Cityscapescript时,出现了以下警告消息。
$ python -m pip install cityscapesscripts
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/matplotlib-3.4.0-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/protobuf-3.19.4-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_applehelp-1.0.2-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_devhelp-1.0.2-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_htmlhelp-2.0.0-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_jsmath-1.0.1-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_qthelp-1.0.3-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_serializinghtml-1.1.5-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/sphinxcontrib_websupport-1.2.4-py3.7-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/zope.event-4.5.0-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Error processing line 1 of /opt/anaconda3/lib/python3.9/site-packages/zope.interface-5.4.0-py3.9-nspkg.pth:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
Remainder of file ignored
Could not import runpy module
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/runpy.py", line 15, in <module>
import importlib.util
File "/opt/anaconda3/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/opt/anaconda3/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/8b90/.local/lib/python3.9/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
从那以后,pip和conda都没有起作用。我收到错误消息,但不知道如何解决问题。
我尝试了以下操作:
AttributeError: type object 'Callable' has no attribute '_abc_registry'
https://pypi.org/project/cityscapesScripts/
下面是Git仓库的链接:https://github.com/open-mmlab/mmdetection
我很乐意得到答案
1条答案
按热度按时间6rqinv9w1#
我收到了同样的错误信息。我找到了我的Python包的安装位置,并手动删除了输入模块(我认为它被称为
typing.py
)文件。据我所知,python 3.7+版本中内置了typing模块,当双重安装时会出现问题。这对我来说是固定的。