wxPython issues while installing on Ubuntu

I am trying to install Psychopy on Ubuntu 22.10, and there seems to be an issue with wxPython where metadata generation fails. Here’s the error report:

 error: subprocess-exited-with-error
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-dyg1vlj_/wxpython_878b2e7d947d435f8a985e2aef6523f1/setup.py", line 27, in <module>
          from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
        File "/tmp/pip-install-dyg1vlj_/wxpython_878b2e7d947d435f8a985e2aef6523f1/buildtools/config.py", line 30, in <module>
          from attrdict import AttrDict
        File "/home/sayantan/.local/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
          from attrdict.mapping import AttrMap
        File "/home/sayantan/.local/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
          from collections import Mapping
      ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Any help will be greatly appreciated. I can’t seem to find any documentation of this problem.