Hi everyone,

I'm following Belanger's guide to getting PYO on the Bela. I have managed to successfully go through the guide and enter all the terminal commands in through an iMac at school, but I'm unsure of how exactly it's supposed to work. I'm assuming we are no able to program in python or use PYO from within the Bela IDE, but have to upload our code and execute from the terminal? Is this true?

Also wondering if anybody has managed to get this loaded on their bela from a Windows machine. I'm a bit lost here.

Thanks,

You can actually use through the IDE alone, which will solve the issues you have on Windows.
Here are some notes, we'll try to add this to the wiki or pyo's docs shortly.

  • get yourself a copy of the pyo source code. Either git clone or download from here.

  • create a new C++ project in the Bela IDE

  • drag on it the files in pyo-bela/common

  • go to the IDE configuration button and paste the following in the Make parameters box:

    CPPFLAGS=-I/usr/include/python2.7;LDLIBS=-lpython2.7;
  • done! Now the project will compile and run, but you need to add a .py file:

    • pick your favourite .py file from pyo-bela/examples, rename it to main.py and add it to the project through the IDE
  • alternatively:

    • add all the .py files from pyo-bela/examples to the project through the IDE, then edit the render.cpp file at line 15 ( char filename[] = "main.py"; ) to select the name of the file you want to run.

For completeness: if you are willing to do the thing on Windows through the scripts, you need a software like mingw or something similar (more info here). This would work just fine for the build_pyo.sh script, but you may not be very lucky with the install_pyo_on_board.sh script, which uses wget and tar which may not be installed on your system. Most of that can actually be done manually in case you need to.

  • hero replied to this.

    Thanks for the info, I did a pretty extensive install of Cygwin yesterday on my laptop to try that out, I don't know if Wget installed or not, but I'd assume tar would be in there. I will give your instructions a try.

    15 days later
    5 years later

    Hi giuliomoro , I tried to follow your steps however it gives an error of Python.h file not found on windows because my project requires 3.6 up. So i made the python version in ake parameters box 2.7 => 3.6 but it gave error of Python.h file not found. When I made it 2.7 again it tries to build but this time different error comes up:

    /usr/bin/ld: /root/Bela/projects/touchme/build/PyoClass.o: undefined reference to symbol 'dlclose@@GLIBC_2.4'
    //lib/arm-linux-gnueabihf/libdl.so.2: error adding symbols: DSO missing from command line
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: [/root/Bela/projects/touchme/touchme] Error 1
    make:
    [/root/Bela/projects/touchme/touchme] Error 2

    these are the outputs with python 2.7 as you wrote above. Could you help me please? Thanks in advance.