momcomepickmeup
momcomepickmeup

Reputation: 1

How to fix "AttributeError: module 'collections' has no attribute 'Mapping'" with experta package?

I'm trying to use the experta library. I installed the library but when I try and run my program, I get an error on this line:

import experta
Traceback (most recent call last):
  File "C:\Users\jodne\PycharmProjects\CPCS331ESproject\TrialNerror.py", line 3, in <module>
    import experta
  File "C:\Users\jodne\PycharmProjects\CPCS331ESproject\venv\Lib\site-packages\experta\__init__.py", line 5, in <module>
    from .engine import KnowledgeEngine
  File "C:\Users\jodne\PycharmProjects\CPCS331ESproject\venv\Lib\site-packages\experta\engine.py", line 13, in <module>
    from experta.fact import InitialFact
  File "C:\Users\jodne\PycharmProjects\CPCS331ESproject\venv\Lib\site-packages\experta\fact.py", line 9, in <module>
    from experta.utils import freeze, unfreeze
  File "C:\Users\jodne\PycharmProjects\CPCS331ESproject\venv\Lib\site-packages\experta\utils.py", line 4, in <module>
    from frozendict import frozendict
  File "C:\Users\jodne\PycharmProjects\CPCS331ESproject\venv\Lib\site-packages\frozendict\__init__.py", line 16, in <module>
    class frozendict(collections.Mapping):
                     ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Mapping'

Pycharm Python Interpreter settings highlighting experta package

What am I missing?

Upvotes: 0

Views: 843

Answers (1)

Mohamed20
Mohamed20

Reputation: 73

Installing experta in a virtual env where I downloaded python 3.8 was the solution that fixed it for me.

Note : 3.9 didn't work, it gave me the same errror

Upvotes: 0

Related Questions