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

sdss_access does not work in Python 3.12 #61

Closed
albireox opened this issue Jun 9, 2024 · 0 comments · Fixed by #62
Closed

sdss_access does not work in Python 3.12 #61

albireox opened this issue Jun 9, 2024 · 0 comments · Fixed by #62
Assignees

Comments

@albireox
Copy link
Member

albireox commented Jun 9, 2024

sdss_access does not work in Python 3.12 because it uses distutils which has been deprecated and removed from standard library in 3.12. Here's an example when running datamodel generate in 3.12, which imports sdss_access

datamodel generate --help
[ERROR]: Traceback (most recent call last):
  File "/Users/gallegoj/.pyenv/versions/datamodel/bin/datamodel", line 5, in <module>
    from datamodel.cli import cli
  File "/Users/gallegoj/Documents/Code/sdss5/datamodel/python/datamodel/cli.py", line 19, in <module>
    from datamodel.generate import DataModel
  File "/Users/gallegoj/Documents/Code/sdss5/datamodel/python/datamodel/generate/__init__.py", line 2, in <module>
    from .datamodel import DataModel
  File "/Users/gallegoj/Documents/Code/sdss5/datamodel/python/datamodel/generate/datamodel.py", line 30, in <module>
    from sdss_access.path import Path
  File "/Users/gallegoj/.pyenv/versions/3.12.3/envs/datamodel/lib/python3.12/site-packages/sdss_access/__init__.py", line 33, in <module>
    from .sync import HttpAccess, Access, BaseAccess, RsyncAccess, CurlAccess
  File "/Users/gallegoj/.pyenv/versions/3.12.3/envs/datamodel/lib/python3.12/site-packages/sdss_access/sync/__init__.py", line 7, in <module>
    from .curl import CurlAccess
  File "/Users/gallegoj/.pyenv/versions/3.12.3/envs/datamodel/lib/python3.12/site-packages/sdss_access/sync/curl.py", line 4, in <module>
    import distutils.spawn
ModuleNotFoundError: No module named 'distutils'

In this particular case it seems that distutils.spawn.find_executable can be replaced with shutil.which.

aws/sagemaker-python-sdk#3028

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

Successfully merging a pull request may close this issue.

1 participant