<< return to Pixycam.com

Getting "python3" to work

Hello. I am using my Pixy2 with my RaspberryPi for my school project. I’m trying to run my script but it is only able to run when I use “sudo python pixyexample.py.” However, I want to able to run it using “sudo python3 pixyexample.py” since my other devices only work with that prompt. I’ve already tried running build_all.sh and still no luck. Any help is appreciated. Here is what I get when I type “sudo python3 pixyexample.py.”

pi@raspberrypi:~/pixy2/build/python_demos $ sudo python3 pixyexample.py
Traceback (most recent call last):
File “/home/pi/pixy2/build/python_demos/pixy.py”, line 14, in swig_import_helper
return importlib.import_module(mname)
File “/usr/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 670, in _load_unlocked
File “”, line 583, in module_from_spec
File “”, line 1043, in create_module
File “”, line 219, in _call_with_frames_removed
ImportError: /home/pi/pixy2/build/python_demos/_pixy.so: undefined symbol: PyInstance_Type

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “pixyexample.py”, line 2, in
import pixy
File “/home/pi/pixy2/build/python_demos/pixy.py”, line 17, in
_pixy = swig_import_helper()
File “/home/pi/pixy2/build/python_demos/pixy.py”, line 16, in swig_import_helper
return importlib.import_module(’_pixy’)
File “/usr/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /home/pi/pixy2/build/python_demos/_pixy.so: undefined symbol: PyInstance_Type

Hello,
Please try rebuilding (run build_all.sh) and see if it reports any errors so we can narrow things down.

Edward