AWS-RunShellScript 调用 python 脚本但找不到 python 模块

AWS-RunShellScript calls python script but can't find python modules

我正在尝试从系统管理器 运行 ec2 上的 shell 脚本。 shell 脚本调用了 运行 和 python 脚本。当我手动 运行 它时它工作得很好,但是如果我通过系统管理器 运行 它说它找不到下载的模块。如果有任何改变,模块就是 numpy。为什么这不起作用?

Why is doesn't this work?

可能是因为 SSM 在其 shell 中未以普通用户(ubuntu 或 ec2-user)身份执行。您应该在系统范围内安装 numpy,或者在您的 AWS-RunShellScript 执行您的脚本时更改您的用户。