我有以下情况:
from meross_iot.controller.mixins.electricity import ElectricityMixin
#!/bin/sh
# launcher.sh
# navigate to home directory, then to this directory, then execute python script, then back home
cd /
cd home/pi/Documents
sudo python meross_electricity.py
cd /
如果我只是执行.py文件,则一切正常,导入完成,等等。如果我尝试运行.sh脚本,则会出现以下错误:
pi@home:~/Documents $ ./launcher.sh
Traceback (most recent call last):
File "meross_electricity.py", line 4, in <module>
from meross_iot.controller.mixins.electricity import ElectricityMixin
ModuleNotFoundError: No module named 'meross_iot'
有人能帮我解决这个问题吗? 谢谢
与sudo一起安装的软件包工作正常
根据@KlausD的评论回答
相关问题 更多 >
编程相关推荐