Aug-04-2021, 04:11 PM
"illegal instruction" means the pi is trying to run code that isn't correct for that machine. This isn't a problem with your python script, it's a problem with the actual python executable or one of the modules imported by your script. You might be able to tell just by seeing if python3 runs on its own. Does
Unfortunately if
python3 -c "print('ok')"
work or get the same error? If that works, you might be able to find what module is causing the problem. Unfortunately if
python3
is broken, sorting that out is going to be something on the Pi side. Could be you need to update some packages, could be it would be better to restart from scratch. We can't tell what happened. Maybe something updated some packages from the wrong repo. Maybe the SD card filesystem became corrupted from a powerdown. Might need to ask in a Pi forum.