2i2c-org / infrastructure

Infrastructure for configuring and deploying our community JupyterHubs.
https://infrastructure.2i2c.org
BSD 3-Clause "New" or "Revised" License
104 stars 64 forks source link

Add py5, a Python Processing library #479

Closed sawula closed 3 years ago

sawula commented 3 years ago

py5 is a new library (currently in beta) for using the Python flavor of Processing. It currently runs in desktop Jupyter notebooks and in mybinder containers. Looking to run in JupyterHub for teaching. Processing's roots are in creative coding, but also education and data visualization. It's reasonable to try include Processing in some introductory data science lessons. I used another Python version of Processing in the classroom (which ran in the Processing IDE ), but always hoped that a library such as this would come about. I'd like to put it through its paces with some students with whom I'm working this summer.

hx2A commented 3 years ago

Hello, I am the creator of py5, and I am chiming in to provide some additional information to help you with this.

py5 is different from other libraries in that it provides most of its functionality by leveraging Processing's Java libraries. It uses jpype as a Java-Python bridge. To get py5 to work in JupyterHub it will need a JVM (specifically, Java 11).

In addition, Processing requires a display of some kind, and for JupyterHub, this should be a virtual frame buffer.

I have py5 working with mybinder in the py5examples repo. You can see in the binder directory the extra stuff I had to do to get it to work. There are additional linux packages that need to be installed for the virtual frame buffer, for Java, and some other stuff for OpenGL. And something needs to start the virtual frame buffer and set a proper DISPLAY environment variable. If those two requirements are met, py5 will work just like any other Python library.

Here is some useful documentation about running Processing without a real display:

https://github.com/processing/processing/wiki/Running-without-a-Display

Let me know if there is anything I can do to help.

yuvipanda commented 3 years ago

It's all set up via github.com/2i2c-org/peddie-image now. Thanks to @hx2A for pointing to the example - the image is a fork of it.