8

Trying to run a program that runs perfectly fine on my local machine, but on AWS I'm getting: TypeError: descriptor '__subclasses__' of 'type' object needs an argument. My pip3 isn't upgraded to the latest version, but that shouldn't be causing an issue since I have downloaded the latest version of rasa_core.

Tried re-installing rasa_core using pip3 -u rasa_core, also tried appending the command with sudo. This is the error I get, can someone please help

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/__init__.py", line 5, in <module>
    from rasa_core.train import train
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/train.py", line 11, in <module>
    from rasa_core.domain import TemplateDomain
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/domain.py", line 12, in <module>
    from rasa_core.actions import Action, action
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/actions/__init__.py", line 1, in <module>
    from rasa_core.actions.action import Action
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/actions/action.py", line 9, in <module>
    from rasa_core import events
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/events/__init__.py", line 73, in <module>
    class Event(object):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/events/__init__.py", line 94, in Event
    default: Optional[Type['Event']] = None
  File "/usr/lib/python3.5/typing.py", line 649, in __getitem__
    return Union[arg, type(None)]
  File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
    dict(self.__dict__), parameters, _root=True)
  File "/usr/lib/python3.5/typing.py", line 512, in __new__
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
    if super().__subclasscheck__(cls):
  File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
    for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument

Can someone please help.

1 Answer 1

11

If your python 3.5 is version 3.5.3 or below, I believe upgrading should fix it. See a relevant issue here

From the relevant error in typing:

typing will only get upgraded with Python if you are on Python 3.5+. Since this issue was fixed in August 2016, I believe any 3.5 release above 3.5.3 should work.

1
  • I have two Ubuntu 16.04 laptops, both have the same tensorflow 2.0.0 versions, both python 3.5.2. One can import tensorflow without a problem, the other gives the above error. The origin of the error may be something other than the python version. The only visible difference between them is that the failing one installed the TF in a virtual environment.
    – hansolo
    Dec 22, 2019 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.