sagemaker-python-sdk icon indicating copy to clipboard operation
sagemaker-python-sdk copied to clipboard

[Warning] Replace distutils.spawn.find_executable with shutil.which

Open santigandolfo opened this issue 4 years ago • 2 comments

The package distutils is deprecated and slated for removal in Python 3.12. We are using the function find_executable that belongs to that package. We should instead be using which from the package shutil.

Therefore we should make the change from from distutils.spawn import find_executable to from shutil import which https://github.com/aws/sagemaker-python-sdk/blob/98bbea65e4c8021ee37fb3609f4aad943c64d771/src/sagemaker/local/image.py#L33

And the change from if find_executable("docker-compose") is None: to if which("docker-compose") is None: https://github.com/aws/sagemaker-python-sdk/blob/98bbea65e4c8021ee37fb3609f4aad943c64d771/src/sagemaker/local/image.py#L90

santigandolfo avatar Mar 25 '22 12:03 santigandolfo

I think this can be considered closed with #4837 @santigandolfo?

lorenzwalthert avatar Oct 04 '24 07:10 lorenzwalthert

This is resolved as of this PR - https://github.com/aws/sagemaker-python-sdk/pull/4837

erickb336 avatar Dec 05 '24 20:12 erickb336