<< return to Pixycam.com

PixyCam and Python Question

Hello,

I was wondering if the pixycam current library works with Python3.5 or Python 3.6. The library I’m referring to is the

Is the swig library and other dependencies only for Python 2 - 2.7? I want to know before I start my machine with a language interpreter
of Python 2 or Python 3.

I searched around the web and couldn’t find a clear answer if Python3 would work. I need Python3 for other libraries and it’s functionality with scheduling, tasks, and another library that only works with Python3.

Hello Ro,
The Pixy Python support should work with either Python2 or 3, although I think Python3 is what most people use.

Hope this helps!

Edward

Hello,
In case anyone else is still looking for this info, PixyCam software (Both for version 1 and 2 of the pixyCam) does not natively support Python3 out of the box.
Sumit Kumar Maitra explains how to update the Swig script.
You can find his walkthrough here. https://piofthings.net/blog/update-5-getting-started-with-pixy-camera
Following his instructions, I updated it for the Pixy2. It is partially working. The pixy.getBlocks() method works well, but the PID in the pan_tilt demo breaks. I am working on a solution. Anyway, anyone interested can check out my git which contains the changes I made.

https://github.com/MrRSquared/pixy2

Good luck.

MrR^2

P.S. The pan_tilt_demo.py file was crashing due to the PIDs trying to set the servos with float values rather than Integers. It is fixed now.
P.P.S. Just kidding. I am still having difficulty tuning the PIDs. Python3 does not like >>10. So, back to the drawing board.
P.P.P.S. I seem to have fixed the integer/ float mismatches, and it is working correctly now. I also checked all of the examples, and it seems that they all work as well. Currently, I am just testing on a Beaglebone Blue, but it seems fully functional with Python3.

1 Like