Have you activated the venv before running the python script?
Here, it fails if I do not activate the venvbut works if I activate it first
Here, it fails if I do not activate the venv
Code:
python pub.pyTraceback (most recent call last): File "/home/pi/myenv/pub.py", line 1, in <module> import paho.mqtt.publish as publishModuleNotFoundError: No module named 'paho'Code:
pi@pibk:~/myenv $ source env/bin/activate(env) pi@pibk:~/myenv $ python pub.py(env) pi@pibk:~/myenv $Statistics: Posted by neilgl — Thu Aug 28, 2025 1:19 pm