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

distutils deprecation with Python 12 preventing mlos_bench from launching #865

Closed
eujing opened this issue Oct 3, 2024 · 3 comments · Fixed by #866
Closed

distutils deprecation with Python 12 preventing mlos_bench from launching #865

eujing opened this issue Oct 3, 2024 · 3 comments · Fixed by #866

Comments

@eujing
Copy link
Contributor

eujing commented Oct 3, 2024

With docker images built on the image python:3.12-slim, mlos_bench (or even the storage API) now fails to run due to the deprecation of distutils

File "/root/.local/lib/python3.12/site-packages/dashboard/main.py", line 5, in <module>
from mlos_bench.storage import Storage
File "/root/.local/lib/python3.12/site-packages/mlos_bench/storage/__init__.py", line 7, in <module>
from mlos_bench.storage.base_storage import Storage
File "/root/.local/lib/python3.12/site-packages/mlos_bench/storage/base_storage.py", line 19, in <module>
from mlos_bench.storage.base_experiment_data import ExperimentData
File "/root/.local/lib/python3.12/site-packages/mlos_bench/storage/base_experiment_data.py", line 8, in <module>
from distutils.util import strtobool  # pylint: disable=deprecated-module
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'

The workaround is to explicitly pip install setuptools to provide distutils, but maybe we want to consider moving away from disutils?

@eujing
Copy link
Contributor Author

eujing commented Oct 3, 2024

@bpkroth @motus

@eujing
Copy link
Contributor Author

eujing commented Oct 3, 2024

I have not looked too deeply into the overall dependency of distutils yet, but if we only need strtobool the official implementation seems short enough to copy into the codebase.

https://github.com/python/cpython/blob/0c5fc27217525c4e40b4064e6979f467540c2fc8/Lib/distutils/util.py#L308

@bpkroth
Copy link
Contributor

bpkroth commented Oct 3, 2024

We test python-3.12 in the pipelines, so not sure what's different here, but I agree, we can just copy that into the one of the utils modules.
Do you want to make a PR or shall I?

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.

2 participants