You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remote Training Job created with decorator not installing pip dependencies #4484
Describe the bug
After upgrading to version 2.212.0, pip dependencies passed as a requirements.txt file in @remote decorator are not installed. Same code works fine in versions up to 2.209.x, fails with versions from 2.210.x.
To reproduce
Just tried with the toy example from the documentation:
And got this in the Training Job, showing no pip install logging before (sagemaker is listed in requirements.txt):
File "/opt/ml/input/data/sagemaker_remote_function_bootstrap/bootstrap_runtime_environment.py", line 24, in <module>
from runtime_environment_manager import (
File "/opt/ml/input/data/sagemaker_remote_function_bootstrap/runtime_environment_manager.py", line 27, in <module>
import sagemaker
ModuleNotFoundError: No module named 'sagemaker'
Using sagemaker sdk versions previous to 2.210.x, the job prints pip install logging and then runs the operation without problems.
We observed equivalent problems in our code for remote functions that were working fine before upgrading.
Expected behavior
The training job should start by installing the dependencies defined in requirements.txt
System information
SageMaker Python SDK version: tried with 2.210.0, 2.211.0, 2.212.0
It seems I still get the same error when using remote decorator in VSCode in Code Editor Space in AWS Sagemaker Studio. Would it be the same issue?
Error is :
/miniconda3/bin/python: Error while finding module specification for 'sagemaker.remote_function.invoke_function' (ModuleNotFoundError: No module named 'sagemaker')
Traceback (most recent call last):
File "/opt/ml/input/data/sagemaker_remote_function_bootstrap/bootstrap_runtime_environment.py", line 574, in main
RuntimeEnvironmentManager()._validate_sagemaker_pysdk_version(
File "/opt/ml/input/data/sagemaker_remote_function_bootstrap/runtime_environment_manager.py", line 361, in _validate_sagemaker_pysdk_version
job_sagemaker_pysdk_version = self._current_sagemaker_pysdk_version()
File "/opt/ml/input/data/sagemaker_remote_function_bootstrap/runtime_environment_manager.py", line 331, in _current_sagemaker_pysdk_version
import sagemaker
ModuleNotFoundError: No module named 'sagemaker'
Seems like it is an issue with the image used. I can confirm this one works:
Activity
nmadan commentedon Mar 8, 2024
Hi @asarasua, thanks for opening an issue for this. We are actively working on a fix.
arun-akur8 commentedon May 22, 2024
Hello!
It seems I still get the same error when using remote decorator in VSCode in Code Editor Space in AWS Sagemaker Studio. Would it be the same issue?
Error is :
/miniconda3/bin/python: Error while finding module specification for 'sagemaker.remote_function.invoke_function' (ModuleNotFoundError: No module named 'sagemaker')Minimal code example:
sagemaker version: 2.200.0, 2.221.0
Python version: 3.8
Boto version: 1.34.109
qqaatw commentedon Jun 2, 2025
Same:
Seems like it is an issue with the image used. I can confirm this one works: