diff --git a/sagemaker-core/src/sagemaker/core/remote_function/runtime_environment/runtime_environment_manager.py b/sagemaker-core/src/sagemaker/core/remote_function/runtime_environment/runtime_environment_manager.py index 5f00317c23..9bc313e85f 100644 --- a/sagemaker-core/src/sagemaker/core/remote_function/runtime_environment/runtime_environment_manager.py +++ b/sagemaker-core/src/sagemaker/core/remote_function/runtime_environment/runtime_environment_manager.py @@ -298,7 +298,7 @@ def _install_requirements_txt(self, local_path, python_executable): """Install requirements.txt file""" # Validate path to prevent command injection validated_path = self._validate_path(local_path) - cmd = [python_executable, "-m", "pip", "install", "-r", validated_path, "-U"] + cmd = [python_executable, "-m", "pip", "install", "-r", validated_path] logger.info("Running command: '%s' in the dir: '%s' ", " ".join(cmd), os.getcwd()) _run_shell_cmd(cmd) logger.info("Command %s ran successfully", " ".join(cmd)) @@ -320,7 +320,7 @@ def _install_req_txt_in_conda_env(self, env_name, local_path): self._validate_env_name(env_name) validated_path = self._validate_path(local_path) - cmd = [self._get_conda_exe(), "run", "-n", env_name, "pip", "install", "-r", validated_path, "-U"] + cmd = [self._get_conda_exe(), "run", "-n", env_name, "pip", "install", "-r", validated_path] logger.info("Activating conda env and installing requirements: %s", " ".join(cmd)) _run_shell_cmd(cmd) logger.info("Requirements installed successfully in conda env %s", env_name) diff --git a/sagemaker-train/src/sagemaker/train/remote_function/runtime_environment/runtime_environment_manager.py b/sagemaker-train/src/sagemaker/train/remote_function/runtime_environment/runtime_environment_manager.py index 9cb0c7aee4..7ae7aa57a4 100644 --- a/sagemaker-train/src/sagemaker/train/remote_function/runtime_environment/runtime_environment_manager.py +++ b/sagemaker-train/src/sagemaker/train/remote_function/runtime_environment/runtime_environment_manager.py @@ -298,7 +298,7 @@ def _install_requirements_txt(self, local_path, python_executable): """Install requirements.txt file""" # Validate path to prevent command injection validated_path = self._validate_path(local_path) - cmd = [python_executable, "-m", "pip", "install", "-r", validated_path, "-U"] + cmd = [python_executable, "-m", "pip", "install", "-r", validated_path] logger.info("Running command: '%s' in the dir: '%s' ", " ".join(cmd), os.getcwd()) _run_shell_cmd(cmd) logger.info("Command %s ran successfully", " ".join(cmd)) @@ -320,7 +320,7 @@ def _install_req_txt_in_conda_env(self, env_name, local_path): self._validate_env_name(env_name) validated_path = self._validate_path(local_path) - cmd = [self._get_conda_exe(), "run", "-n", env_name, "pip", "install", "-r", validated_path, "-U"] + cmd = [self._get_conda_exe(), "run", "-n", env_name, "pip", "install", "-r", validated_path] logger.info("Activating conda env and installing requirements: %s", " ".join(cmd)) _run_shell_cmd(cmd) logger.info("Requirements installed successfully in conda env %s", env_name)