Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError on Python 3.12 #3951

Open
jaraco opened this issue Dec 11, 2023 · 8 comments
Open

ModuleNotFoundError on Python 3.12 #3951

jaraco opened this issue Dec 11, 2023 · 8 comments

Comments

@jaraco
Copy link
Contributor

jaraco commented Dec 11, 2023

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

 @ 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.

jaraco added a commit to jaraco/recapturedocs that referenced this issue Dec 11, 2023
@jaraco
Copy link
Contributor Author

jaraco commented Dec 11, 2023

The issue was fixed in benjaminp/six#352. This package just needs to refresh its vendored copy (or stop vendoring).

jaraco added a commit to jaraco/recapturedocs that referenced this issue Dec 11, 2023
@tillea
Copy link

tillea commented Dec 12, 2023

Apropos Python 3.12:

$ grep -R 'imp\.'
boto/plugin.py:    (file, filename, data) = imp.find_module(name, [path])
boto/plugin.py:        return imp.load_module(name, file, filename, data)
boto/pyami/launch_ami.py:        l = imp.find_module(params['script_name'])

imp module is deprecated as well and these statements need to be replaced by their importlib replacements.
Kind regards, Andreas.

@nateprewitt
Copy link

Hey everyone, just wanted to make sure we're talking about the right package.

This repo, boto was deprecated in 2020 and the last supported Python 3 version was 3.4. It's unlikely this package will ever work with Python 3.12.

The current AWS SDK for Python, boto3, can be found here and does support Python 3.12.

@tillea
Copy link

tillea commented Dec 12, 2023

Yes, I really meant this repository since toil is using it which I reported there. Thanks for the clarification.

@jaraco
Copy link
Contributor Author

jaraco commented Dec 13, 2023

Last I checked, boto3 was not a replacement for boto, as it did not have any mechanical turk support, which was the reason I've continued to rely on boto. I'm not actually using the library, just maintaining tests on a defunct project. I took a quick look at the boto3 project, and it indeed doesn't have a package mentioning mechanical turk, so it looks like I'm screwed. I guess I'll just stub out all of the boto behaviors in the project.

correction: searching the issues in boto3, there are references to people using MTurk, so it seems it may in fact be supported by boto3. Maybe I'll consider porting the project.

@nateprewitt
Copy link

I can't speak for complete feature parity on mturk, but boto3 has supported the majority of the public APIs for ~7 years now. Full documentation can be found here.

@tillea
Copy link

tillea commented Dec 13, 2023

Maybe I'll consider porting the project.

This would be really appreciated.

@jaraco
Copy link
Contributor Author

jaraco commented Dec 14, 2023

I did find I was nominally able to convert the project to boto3. I had to grab some data structures from stack overflow to support the custom question and some development will still be required if I ever revive the project properly, but at least I was able to drop the dependency on boto. Thanks for the encouragement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants