Closed evayann closed 2 years ago
@evayann , thank you for the bug report.
py5 currently has some shortcomings on Mac computers. They are documented on the website: http://py5.ixora.io/content/osx_users.html
If you run this in a Jupyter notebook and execute %gui osx
in the first cell, you should be able to run your example:
%gui osx
import py5
and then
def setup():
py5.size(500, 500)
def draw():
py5.circle(250, 250, 50)
py5.run_sketch()
The %gui osx
command is a special magic command that activates an event loop that allows py5 to work on Mac computers. It is only available in Jupyter. It is not available when executing through a regular Python interpreter. Right now there is no way to run py5 in the regular Python interpreter, but this is something I want to make a priority for the future.
You can run py5 through the command line tool run_sketch
. That does not involve Jupyter's magic command as it is doing something else.
However, I now see a number of new critical problems. First, if I leave out the %gui osx
command, I see this message:
Importing py5 on OSX but the necessary Jupyter OSX event loop not been activated. I'll activate it for you, but next time, execute `%gui osx` before importing this library.
Which (1) has a grammar error and (2) doesn't actually activate the event loop. This is a new bug.
Second, I see that if I combine both of the above cells into 1 cell, it doesn't work. And third, if the first (and only the first) Sketch I try to run uses the P2D
or P3D
renderer, it doesn't work. Both of these are new bugs.
So, I have some work to do. Mac computers have caused a lot of headaches and I have more to deal with it seems. The truth is I didn't even have a Mac to test on for the first year of this project because of the pandemic, so it is a bit behind the other platfoms. Please bear with me as I work through these issues.
@evayann Let's keep this open for now.
I now have a fix for this. Plus, I can now run py5 outside of Jupyter, which I've wanted to do for ages but haven't been able to get working until now. I still don't know what to do about the Apple Silicon issues and have some testing to do, but I am very happy with the progress I've made this weekend.
Aiming to do a new release in the next few weeks.
Nice job ! I wait your next feature to test it and make a feedback ! ^^
Today's release of py5 should fix most (or all) of the OSX problems. Please read the rewritten Special Notes for OSX Users page and create a new issue if you see something that doesn't work. Thanks!
Setup : MacBook Air M1 16Go RAM Java 17 / Python 3.9
When I start a simple sketch, nothing append. I just have python logo on dock (see picture).
If I force shutdown of program, I have this exception append (if it can help) :