[SOLVED] AttributeError: type object 'Callable' has no attribute '_abc_registry'

Anyone seen this error with plone.restapi under Plone 5.2.1, Python 3?

  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/setuptools-42.0.2-py3.7.egg/pkg_resources/__init__.py", line 361, in get_provider
    __import__(moduleOrReq)
  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/plone.restapi-6.1.0-py3.7.egg/plone/restapi/__init__.py", line 4, in <module>
    from plone.restapi.pas import plugin
  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/plone.restapi-6.1.0-py3.7.egg/plone/restapi/pas/plugin.py", line 19, in <module>
    import jwt
  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/PyJWT-1.7.1-py3.7.egg/jwt/__init__.py", line 19, in <module>
    from .api_jwt import (
  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/PyJWT-1.7.1-py3.7.egg/jwt/api_jwt.py", line 7, in <module>
    from typing import Callable, Dict, List, Optional, Union # NOQA
  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/typing-3.7.4.1-py3.7.egg/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/typing-3.7.4.1-py3.7.egg/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/ajung/sandboxes/plone-server-buildout-plone5/eggs/Products.CMFPlone-5.2.1-py3.7.egg/Products/CMFPlone/meta.zcml", line 38.4-42.10
    File "/home/ajung/sandboxes/plone-server-buildout-plone5/parts/instance/etc/site.zcml", line 12.2-12.39
    AttributeError: type object 'Callable' has no attribute '_abc_registry'

Isn't typing a builtin and you have it there as an egg?

1 Like

Obviously a Python 2 port of the "typing" module was in the way

I have the same error message,
My env is plone 5.2.10, and build in ubuntu 22.04, a all new ubutnu VM.
How to solve it? have any suggestion?

Andy Fang via Plone Community wrote at 2022-11-29 17:06 +0000:

I have the same error message,
My env is plone 5.2.10, and build in ubuntu 22.04, a all new ubutnu VM.
How to solve it? have any suggestion?

I analysed this problem recently: typing was a dependency of
python-dotenv and this a dependency of waitress.
Pinning the most recent versions for waitress and python-dotenv
has solved the problem.

Thanks, I pinning python-dotenv to reecnt version
But, have a new problem found, as above

# AttributeError: type object 'Callable' has no attribute '_abc_registry'

Finally, I install python3.8 in ubuntu 22.04 to solve this issue.

Andy Fang via Plone Community wrote at 2022-11-30 05:29 +0000:

Thanks, I pinning python-dotenv to reecnt version
But, have a new problem found, as above

# AttributeError: type object 'Callable' has no attribute '_abc_registry'

Finally, I install python3.8 in ubuntu 22.04 to solve this issue.

Plone 5.2.10 definitely can be used with Python 3.10 --
at least if one ignores many import warnings.

To reduce the number of import warnings, I use different
pins (to the most recent versions) for setuptools and zc.buildout.