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

preguntada hace 3 años713 visualizaciones
2 Respuestas
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
respondido hace 3 años
0

Installing also awsiotsdk did the trick!
Thank you

respondido hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas