jaredks / rumps

Ridiculously Uncomplicated macOS Python Statusbar apps
BSD 3-Clause "New" or "Revised" License
3.06k stars 177 forks source link

ImportError: cannot import name 'Mapping' from 'collections' #169

Closed PyKoch closed 2 years ago

PyKoch commented 2 years ago

I'm running the first example on the documentation. The result is this error:

Traceback (most recent call last):
  File "/Users/vk0604/essence/rumps_nmore/rumps_test.py", line 1, in <module>
    import rumps
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/rumps/__init__.py", line 25, in <module>
    from .rumps import (separator, debug_mode, alert, notification, application_support, timers, quit_application, timer,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/rumps/rumps.py", line 33, in <module>
    from collections import Mapping, Iterable
ImportError: cannot import name 'Mapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

Python version 3.10.0 OSX 10.14.6

Does rumps.py need updating? The issue seems to occur with various packages.

Any wisdom?

PyKoch commented 2 years ago

Replacing from collections import Mapping, Iterable with from collections.abc import Mapping, Iterable, MutableMapping in rumps.py did the trick.