<< return to Pixycam.com

Libpixyusb python module trouble


#1

Hi there thanks for looking at this,

I am a beginner at python and having trouble using the libpixyusb module.

I followed the instructions to build the module on my mac, and was able to build and run the demos via the command line.

Now I am trying to include the module in another project, and I am not sure where the “module” is or what files it comprises.

I need to get all of the pixy module dependencies together because my application is a game, and I need to package all the dependencies along with the python interpreter in the game itself.

I have tried copying all of the files in the ‘python_demos’ folder into my game folder, and “import pixy” in the game python code doesn’t throw an error - but none of the pixy attributes are defined or usable. In short, I’m stuck and in over my head - I’d appreciate any advice or new avenues to try.

Thanks in advance.


#2

Hello,
Did you copy the ~/build/python_demos directory over? If those demos work from that directory, you should be able to copy them to different locations and run them. hmm…

Edward


#3

Hi Edward, thank you for looking at this!

I copied the build/python_demos directory and I am able to run the demos in the new directory from the terminal python.

However even though all the python_demos directory content is being loaded by the game, and it is able to “import pixy” without an error or warning, trying to use anything from pixy in the game python causes attribute not defined errors.

The game’s python interpreter is python3.6 and it has a lib file to which I tried adding a new directory named “pixy” with the pixy demos contents, but that made no difference: “import pixy” doesn’t error but I can’t access the attributes. I have noticed that the other libraries mostly have an init file in them, but wasn’t sure if this was necessary in pixy’s case.


#4

Hello,
I believe you need to copy the pixy.i, pixy.py and swig.dat files over as well.

Edward