I'm attempting to use the stream manager sdk for GG version 2: https://github.com/aws-greengrass/aws-greengrass-stream-manager-sdk-python
I installed the requirements for stream manager on my test core machine:
pip3 install --user -r requirements.txt
Then I installed the sdk by downloading the source code and running:
sudo python3 setup.py install
After installing the sdk, I realized that the installed .egg file was not readable by users outside of root/staff so I chmod'd to allow others to read it. Then I re-tested and it cannot read the cbor2 module. I ran another test component that just imported cbor2. It failed with the same errors as below.
The log for my component contains this error:
2021-02-03T19:47:26.630Z [WARN] (Copier) com.example.stream.create: stderr. Traceback (most recent call last):. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-03T19:47:26.630Z [WARN] (Copier) com.example.stream.create: stderr. File "create-stream.py", line 5, in <module>. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-03T19:47:26.630Z [WARN] (Copier) com.example.stream.create: stderr. import cbor2. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
2021-02-03T19:47:26.630Z [WARN] (Copier) com.example.stream.create: stderr. ModuleNotFoundError: No module named 'cbor2'. {scriptName=services.com.example.stream.create.lifecycle.Run.script, serviceName=com.example.stream.create, currentState=RUNNING}
Then I tried adding pip3 install cbor2 to the install script of the component recipe. This didn't install correctly:
2021-02-03T20:48:47.613Z [WARN] (Copier) com.example.stream.create: stderr. Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-l9bd94a1/cbor2/. {scriptName=services.com.example.stream.create.lifecycle.Install.script, serviceName=com.example.stream.create, currentState=NEW}
2021-02-03T20:48:47.669Z [WARN] (pool-2-thread-67) com.example.stream.create: shell-runner-error. {scriptName=services.com.example.stream.create.lifecycle.Install.script, serviceName=com.example.stream.create, currentState=NEW, command=["pip3 install cbor2 "]}
On the same machine, I can run a python3 script directly and both cbor2 and stream_manager run fine (except of course for stream manager complaining about authorization). What could be causing the module loading problems?
Thanks!