GGC v2 component can not find python module awsiot

0

I created a GG v2 component and want to use the awsiot component inside a python file of the component.
So i added this script line to my recipe:
"Install":
{
"Script": "python3 -m pip install awsiot"
},

When i try to run the component the module installs just fine:
2021-05-13T09:13:06.470Z INFO (Copier) com.Componet.Test: stdout. Requirement already satisfied: awsiot in /home/ggc_user/.local/lib/python3.7/site-packages (0.1.3). {scriptName=services.com.Component.Test.lifecycle.Install.Script, serviceName=com.Component.Test, currentState=NEW}

But when i try to import the module the error occurs:
2021-05-13T09:13:07.125Z WARN (Copier) com.Component.Test: stderr. ModuleNotFoundError: No module named 'awsiot'. {scriptName=services.com.Component.Test.lifecycle.Run, serviceName=com.Component.Test, currentState=RUNNING}

I assume it has something to do with user privilegs. Is the python script not called by default with the user ggc_user specified in when installing the core device with the option --component-default-user ggc_user:ggc_group ?

Any advice would be appreciated.

Thanks,
Sebastian

질문됨 3년 전713회 조회
2개 답변
0

Hi SebastianBerryroad,

You would have to install awsiotsdk https://pypi.org/project/awsiotsdk/ and also add --user in the pip command.
Could you give this another try with those changes and let me know if that works for you?

Thanks,
Navya.

AWS
답변함 3년 전
0

Installing also awsiotsdk did the trick!
Thank you

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠