#3951·boto

ModuleNotFoundError on Python 3.12

Author: jaracoCreated Dec 11, 2023Updated Dec 14, 2023

Today I tried to import boto on Python 3.12 and it fails with this error:

bash
 @ py -3.12 -m pip-run boto -- -c 'import boto'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/folders/sx/n5gkrgfx6zd91ymxr2sr9wvw00n8zm/T/pip-run-i0xd1pbv/boto/__init__.py", line 27, in <module>
    from boto.pyami.config import Config, BotoConfigLocations
  File "/var/folders/sx/n5gkrgfx6zd91ymxr2sr9wvw00n8zm/T/pip-run-i0xd1pbv/boto/pyami/config.py", line 29, in <module>
    from boto.compat import expanduser, ConfigParser, NoOptionError, NoSectionError, StringIO
  File "/var/folders/sx/n5gkrgfx6zd91ymxr2sr9wvw00n8zm/T/pip-run-i0xd1pbv/boto/compat.py", line 52, in <module>
    from boto.vendored.six.moves import filter, http_client, map, _thread, \
ModuleNotFoundError: No module named 'boto.vendored.six.moves'

It seems whatever hack six uses to make "six.moves" appear as a package even though "six" is a simple module no longer works on Python 3.12, making boto unusable on Python 3.12.