ModuleNotFoundError: No module named 'sagemaker'

I am attempting to perform pre-processing using sklearn in sagemaker. As a pre-requisite I am trying to import sagemaker module:

%pip install -qU 'sagemaker>=2.15.0'
import boto3
import sagemaker

but I get error as:

An error was encountered:
No module named 'sagemaker'
Traceback (most recent call last):
ModuleNotFoundError: No module named 'sagemaker'

Any pointers will be helpful.

1 answer

  • answered 2022-03-08 17:06 Heiko Hotz

    This error message means that, despite your first line of code, the sagemaker module was not installed on your system. Remove the -q (quiet) option to see the error message and why the module wasn't installed. My guess is that you need to use double quotes instead of single quotes when specifying a specific version number (e.g. pip install "sagemaker>=2.15.0").

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum