'I can not import rumps in python 3 i get an error about mapping

trying to just import rumps in python 3 on osx monterey and getting this error. I tried pip3 install mapping, installing pyobjc and i can't get anything to work. i have python version 3.10.4

  File "/Users/Aphixe/PycharmProjects/lightmenubar/main.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)```


Solution 1:[1]

When containers are on the same bridge network, they can talk to each other using their service names as hostnames. In your case, the wordpress container can talk to the database container using the hostname db. Since it's not talking via the host, any port mapping is irrelevant and you just connect on port 3306.

So if you change

WORDPRESS_DB_HOST: [addr. of PI]:3382

to

WORDPRESS_DB_HOST: db

it should work.

You can remove the port mapping on the database container if you don't need to access the database directly from the host.

Solution 2:[2]

Ok, learned something today, like everyday.

Better to have such installations all nicely seperated in different networks and also better do not use same container names, such as DB. Better seperate them like DB-WP1, DB-WP2, etc....

In my setup, I couldn“t see any reason, why it should interfere with each other, but doing the above will not harm anything at all....

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hans Kilian
Solution 2 Zaphod