简体   繁体   English

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

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

I am attempting to run a shell script on an ec2 from the systems manager.我正在尝试从系统管理器在 ec2 上运行 shell 脚本。 The shell script has a call to run a python script. shell 脚本调用了运行 python 脚本。 It works perfectly when I run it manually, but if I run it through the systems manager it says it can't find the downloaded module.当我手动运行它时它工作得很好,但是如果我通过系统管理器运行它,它会说它找不到下载的模块。 The module is numpy if that changes anything.如果有任何改变,该模块是 numpy。 Why is doesn't this work?为什么这不起作用?

Why is doesn't this work?为什么这不起作用?

Probably because SSM does not execute as your normal user (ubuntu or ec2-user) in its shell.可能是因为 SSM 在其 shell中没有作为您的普通用户(ubuntu 或 ec2-user)执行。 You should install numpy system wide, or change your user when your AWS-RunShellScript executes your scripts.您应该在系统范围内安装 numpy,或者在您的 AWS-RunShellScript 执行您的脚本时更改您的用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM