I've got a script that uses the Google Assistant Library and has to import some modules from there. I figured out this only works in a Python Virtual Environment, which is really strange. In the same folder I've got a script which uses the GPIO pins and has to use root. They interact with each other, so when I start the GPIO script, the Assistant script is also started. But for some reason the modules in there can't import when the script is started with root. Does anybody know something about this?
I ended up just installing the python package as sudo and it worked fine. For my case it was sudo pip3 install findpi and then executed as sudo findpi and worked.
Python can't find module when started with sudo