Skip to content
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

Can't get GLFW to work on WSL. #343

Open
dparvaz opened this issue Jun 7, 2022 · 2 comments
Open

Can't get GLFW to work on WSL. #343

dparvaz opened this issue Jun 7, 2022 · 2 comments

Comments

@dparvaz
Copy link

dparvaz commented Jun 7, 2022

Describe the bug
Attempts to run import p5 in python running in WSL results in the error shown in "screenshots" below.

According to apt-get GLFW is installed, but that seems to be the point of failure.

To Reproduce

❯ pip install p5 --user
❯ sudo apt-get install libglfw3
❯ python
[...]
>>> import p3

Expected behavior
I expect no errors and for p5 to be imported.

Screenshots

❯ python
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import p3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'p3'
>>> import p5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/__init__.py", line 19, in <module>
    from .sketch import *
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/sketch/__init__.py", line 21, in <module>
    from .userspace import *
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/sketch/userspace.py", line 30, in <module>
    from .base import Sketch
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/sketch/base.py", line 26, in <module>
    from ..core import p5
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/core/__init__.py", line 18, in <module>
    from .structure import *
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/core/structure.py", line 21, in <module>
    from . import primitives
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/core/primitives.py", line 28, in <module>
    from .shape import PShape
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/core/shape.py", line 31, in <module>
    from . import p5
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/core/p5.py", line 21, in <module>
    from .tess import Tessellator
  File "/home/dparvaz/.local/lib/python3.9/site-packages/p5/core/tess.py", line 1, in <module>
    from OpenGL.GLU import gluNewTess, gluTessCallback, GLU_TESS_VERTEX, GLU_TESS_BEGIN, GLU_TESS_END, GLU_TESS_ERROR, \
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/GLU/__init__.py", line 8, in <module>
    from OpenGL.GLU.projection import *
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/GLU/projection.py", line 3, in <module>
    from OpenGL import GL
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/GL/__init__.py", line 4, in <module>
    from OpenGL.GL.VERSION.GL_1_1 import *
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in <module>
    from OpenGL.raw.GL.VERSION.GL_1_1 import *
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in <module>
    from OpenGL.raw.GL import _errors
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/raw/GL/_errors.py", line 4, in <module>
    _error_checker = _ErrorChecker( _p, _p.GL.glGetError )
  File "src/errorchecker.pyx", line 20, in OpenGL_accelerate.errorchecker._ErrorChecker.__init__
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 15, in __get__
    value = self.fget( obj )
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 356, in CurrentContextIsValid
    return self.GetCurrentContext
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 15, in __get__
    value = self.fget( obj )
  File "/home/dparvaz/.local/lib/python3.9/site-packages/OpenGL/platform/egl.py", line 106, in GetCurrentContext
    return self.EGL.eglGetCurrentContext
AttributeError: 'NoneType' object has no attribute 'eglGetCurrentContext'

System information:
WSL running Ubuntu on Windows 11.

❯ pip list | egrep "glfw|p5"
glfw                         2.5.3
p5                           0.7.1
❯ python --version
Python 3.9.7
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2022

Thank you for submitting your first issue to p5py

@kimpaller
Copy link

encountered the same issue

pip list | egrep "glfw|p5"
glfw 2.7.0
p5 0.8.4

python --version
Python 3.10.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants