ModuleNotFoundError:没有名为“sagemaker”的模块;
我正在尝试使用 sagemaker 中的 sklearn 执行预处理。作为先决条件,我尝试导入 sagemaker 模块:
%pip install -qU 'sagemaker>=2.15.0'
import boto3
import sagemaker
但出现错误:
An error was encountered:
No module named 'sagemaker'
Traceback (most recent call last):
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此错误消息意味着,尽管您有第一行代码,但 sagemaker 模块并未安装在您的系统上。删除
-q
(安静)选项以查看错误消息以及未安装模块的原因。我的猜测是,在指定特定版本号时,您需要使用双引号而不是单引号(例如pip install "sagemaker>=2.15.0"
)。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"
).