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

gefragt vor 3 Jahren713 Aufrufe
2 Antworten
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
beantwortet vor 3 Jahren
0

Installing also awsiotsdk did the trick!
Thank you

beantwortet vor 3 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen