Skip to content

Commit 6abfcf7

Browse files
committed
Use distutils instead of shutil to support python2.
1 parent 2be9926 commit 6abfcf7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sagemaker/local/image.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import tarfile
3030
import tempfile
3131

32+
from distutils.spawn import find_executable
3233
from threading import Thread
3334
from six.moves.urllib.parse import urlparse
3435

@@ -78,10 +79,11 @@ def __init__(self, instance_type, instance_count, image, sagemaker_session=None)
7879
from sagemaker.local.local_session import LocalSession
7980

8081
# check if docker-compose is installed
81-
if shutil.which('docker-compose') is None:
82+
if find_executable('docker-compose') is None:
8283
raise ImportError(
83-
"'docker-compose' is not installed. Local mode feature will be broken. " +
84-
"For more information on how to install 'docker-compose', please, see " +
84+
"'docker-compose' is not installed. "
85+
"Local Mode features will not work without docker-compose. "
86+
"For more information on how to install 'docker-compose', please, see "
8587
"https://docs.docker.com/compose/install/"
8688
)
8789

0 commit comments

Comments
 (0)