I have a ArtifactInstall_Enter_01_yes.py script as such,
#!/usr/bin/python3 # Import libraries import os, pwd import zmq # draw on default display regardless where run from # script mandatory for having access to raspberry pi # missing these lines give 'execution format error' os.environ["DISPLAY"] = ":0" pwstruct = pwd.getpwnam("pi") os.setgid(pwstruct.pw_uid) os.setuid(pwstruct.pw_gid) # mandatory to add context to a socket context = zmq.Context() # enable socket as REQUEST socket = context.socket(zmq.REQ) # Open port for connection and make sure it is not default port like 8888, 50 socket.connect("tcp://localhost:5558") print("Sending request ...") # Send message via the port socket.send(b"New Update")
This gives me the following error in Mender server log
ImportError: No module named ‘zmq’
I have installed zmq from root on my device. What could be the problem ?
Thanks in advance.