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

demandé il y a 3 ans713 vues
2 réponses
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
répondu il y a 3 ans
0

Installing also awsiotsdk did the trick!
Thank you

répondu il y a 3 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions