systeminformer icon indicating copy to clipboard operation
systeminformer copied to clipboard

errorMessage: module 'typing' has no attribute _ClassVar | while running whispers on lambda python 3.9

Open bheemuni-raju opened this issue 2 years ago • 6 comments

{ "errorMessage": "module 'typing' has no attribute '_ClassVar'", "errorType": "AttributeError", "requestId": "ac8561f5-dc64-42e5-af44-9f3c942ef80d", "stackTrace": [ " File "/var/task/lambda_function.py", line 13, in lambda_handler\n for secret in whispers.secrets(args):\n", " File "/opt/python/whispers/init.py", line 14, in secrets\n from whispers.core.args import parse_args\n", " File "/opt/python/whispers/core/args.py", line 7, in \n from whispers.core.utils import DEFAULT_PATH, default_rules, load_regex\n", " File "/opt/python/whispers/core/utils.py", line 12, in \n from whispers.models.pair import KeyValuePair\n", " File "/opt/python/whispers/models/pair.py", line 6, in \n class KeyValuePair:\n", " File "/opt/python/dataclasses.py", line 958, in dataclass\n return wrap(_cls)\n", " File "/opt/python/dataclasses.py", line 950, in wrap\n return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)\n", " File "/opt/python/dataclasses.py", line 800, in _process_class\n cls_fields = [_get_field(cls, name, type)\n", " File "/opt/python/dataclasses.py", line 800, in \n cls_fields = [_get_field(cls, name, type)\n", " File "/opt/python/dataclasses.py", line 659, in _get_field\n if (_is_classvar(a_type, typing)\n", " File "/opt/python/dataclasses.py", line 550, in _is_classvar\n return type(a_type) is typing._ClassVar\n" ] }

bheemuni-raju avatar Apr 24 '22 09:04 bheemuni-raju

Hey @bheemuni-raju, thanks for raising! Which version of whispers are you using?

adeptex avatar Apr 28 '22 16:04 adeptex

Hi @adeptex I'm using whispers 2.0.5 version.

bheemuni-raju avatar Apr 29 '22 04:04 bheemuni-raju

Hi @adeptex Any update on this?

bheemuni-raju avatar May 02 '22 06:05 bheemuni-raju

hey @bheemuni-raju, I think the problem is with having dataclasses installed. So short term fix is to pip3 uninstall dataclasses on Python 3.9.. but i have not yet done any testing.

Also FYI, this repo is for version 1. Version 2 is at https://github.com/adeptex/whispers, so the changes will be implemented there.

adeptex avatar May 02 '22 19:05 adeptex

hi @bheemuni-raju did you try uninstalling dataclasses? Did it work for you?

adeptex avatar May 03 '22 22:05 adeptex

hey @bheemuni-raju, this issue is addressed in 2.0.6 - https://github.com/adeptex/whispers

adeptex avatar May 12 '22 20:05 adeptex