-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'p5.core.p5' has no attribute 'exit' #150
Comments
@Gautameshwar , by default p5 uses glfw backend, to use p5 within Jupyter notebook, there needs to be some support for WebGL inside p5 which doesnt exist (yet). |
But what about spyder environment? It would still be a great help if i could run p5 codes on spyder, if not jupyter... |
Perhaps see #133, and #76 (comment) |
Running the code inside ipython, I have the same error. Then I put the script in .py file and run it on conda shell environment and it works. So, just for note that I think this error related to ipython/jupyter notebook rather than how it works in conda environment. If you like Spyder, then for current situation, I suggest to use VScode which have its terminal window and run the script using command |
I have the same problem. In fact importing p5 in spyder also does not work when i open spyder from anaconda shell. But works if i open spyder from Windows command prompt. |
Just ran into this, it appears to be a bug rather than an enhancement.
|
Example which errors:
Tested with p5 0.7.1 / python 3.9.1 / macOS 10.15.7. I also see that p5.sketch.base has a Interestingly, I don't see base.py in that directory here on Github? It looks like master has been refactored a bit since release. That method is now at https://github.com/p5py/p5/blob/master/p5/sketch/Vispy2DRenderer/base.py#L149 |
To clarify, there are two different errors:
In addition, |
Replacing
I'm not sure if this has any implications for cleanup code, but at least there are no more exceptions (so far). |
|
It works fine for me, with version 0.7.1. What is the environment you are working in? |
I shared my environment earlier, may have gotten a bit lost in the thread - tested with p5 0.7.1 / python 3.9.1 / macOS 10.15.7. |
The exception is thrown after clicking the close window "X" in p5's GUI. |
This solved for me: Inside the following file:
just add these few lines.
|
The issue still persists, as of this comment. I installed it today (10/march/2021). And ran the simple example from the docs page: I ran it from the terminal and still get this error:
OS: Ubuntu 20.04 |
Describe the bug
I tried running the sample code in p5 README text in spyder 4, Jupyter Notebook, and external windows terminal. The same error(AttribureError: ...) pops up in the first two. The terminal , however properly executes this code. Please let me know how to fix it. (i find it comfortable to run codes in those environments...)
To Reproduce
Try running the code in those environments:
samplep5.txt
Screenshots
The errors i got in the two environments
error_jupy.txt
:
error_spy.txt
System information:
The text was updated successfully, but these errors were encountered: