-
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
Code works, but unresolved reference errors in the editor and many errors generated on running #340
Comments
Thank you for submitting your first issue to p5py |
Same issue here on macOS 11.6.5, running the example from the README
|
Hi, any update on this? |
Same issue here with p5 0.7.1 on Python 3.6.8 |
Same issue p5 0.7.1 on Python 3.8 |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a test that I had installed things correctly, I ran the example program here: https://github.com/p5py/p5
The program runs exactly as shown in the gif, but:
-Lots of errors are generated when I run the code.
I'm using:
See below for code and error messages from PyCharm and IDLE below.
Thank you!
======= Code =========
(as copied form github)
from p5 import *
def setup():
size(640, 360)
no_stroke()
background(204)
def draw():
if mouse_is_pressed:
fill(random_uniform(255), random_uniform(127), random_uniform(51), 127)
else:
fill(255, 15)
def key_pressed(event):
background(204)
run()
===== Error messages, PyCharm =====
C:\Users\tim\PycharmProjects\Processing\venv\Scripts\python.exe C:/Users/tim/PycharmProjects/Processing/main.py
WARNING: Traceback (most recent call last):
File "C:\Users\tim\PycharmProjects\Processing\main.py", line 21, in
run()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\userspace.py", line 155, in run
p5.sketch = Sketch(setup_method, draw_method, handlers, frame_rate)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\base.py", line 60, in init
app.Canvas.init(
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\app\canvas.py", line 211, in init
self.create_native()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\app\canvas.py", line 228, in create_native
self._app.backend_module.CanvasBackend(self, **self._backend_kwargs)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\app\backends_glfw.py", line 298, in init
self._on_resize(self._id, size[0], size[1])
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\app\backends_glfw.py", line 394, in _on_resize
self._vispy_canvas.events.resize(
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\util\event.py", line 453, in call
self._invoke_callback(cb, event)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\base.py", line 157, in on_resize
p5.renderer.reset_view()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\renderer2d.py", line 82, in reset_view
self.texture_prog['modelview'] = self.modelview_matrix.T.flatten()
TypeError: 'NoneType' object does not support item assignment
ERROR: Invoking <bound method Sketch.on_resize of <Sketch (Glfw) at 0x2a7316861d0>> for ResizeEvent
Exception ignored on calling ctypes callback function: <function CanvasBackend.on_close at 0x000002A73195C9D0>
Traceback (most recent call last):
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\glfw_init.py", line 660, in callback_wrapper
return func(*args, **kwargs)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\app\backends_glfw.py", line 400, in _on_close
self._vispy_canvas.close()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\app\canvas.py", line 463, in close
self.events.close()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\util\event.py", line 453, in call
self._invoke_callback(cb, event)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\base.py", line 148, in on_close
exit()
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib_sitebuiltins.py", line 26, in call
raise SystemExit(code)
SystemExit: None
Traceback (most recent call last):
File "C:\Users\tim\PycharmProjects\Processing\main.py", line 21, in
run()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\userspace.py", line 167, in run
exit()
File "C:\Users\tim\PycharmProjects\Processing\venv\lib\site-packages\p5\sketch\userspace.py", line 250, in exit
p5.exit(*args, **kwargs)
AttributeError: module 'p5.core.p5' has no attribute 'exit'
Process finished with exit code 1
===== Error Messages, IDLE =====
WARNING: Traceback (most recent call last):
File "", line 1, in
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\idlelib\run.py", line 164, in main
ret = method(*args, **kwargs)
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\idlelib\run.py", line 578, in runcode
exec(code, self.locals)
File "C:/Users/tim/AppData/Local/Programs/Python/Python310/test.py", line 21, in
run()
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 155, in run
p5.sketch = Sketch(setup_method, draw_method, handlers, frame_rate)
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 60, in init
app.Canvas.init(
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 211, in init
self.create_native()
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 228, in create_native
self._app.backend_module.CanvasBackend(self, **self._backend_kwargs)
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends_glfw.py", line 298, in init
self._on_resize(self._id, size[0], size[1])
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends_glfw.py", line 394, in _on_resize
self._vispy_canvas.events.resize(
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in call
self._invoke_callback(cb, event)
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 157, in on_resize
p5.renderer.reset_view()
File "C:\Users\tim\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\renderer2d.py", line 82, in reset_view
self.texture_prog['modelview'] = self.modelview_matrix.T.flatten()
TypeError: 'NoneType' object does not support item assignment
ERROR: Invoking <bound method Sketch.on_resize of <Sketch (Glfw) at 0x28636a93430>> for ResizeEvent
The text was updated successfully, but these errors were encountered: