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

OpenGL.error.Error: Attempt to retrieve context when no valid context #26

Open
hail-mary opened this issue Nov 6, 2024 · 3 comments
Open

Comments

@hail-mary
Copy link

Hi, thanks for sharing the amazing repository!
I installed from source on WSL2 Ubuntu 24.04. The installation completed without any problem. However, when I ran

 python examples/piano_with_shadow_hands_env.py

got this error.

OpenGL.error.Error: Attempt to retrieve context when no valid context

I found os.environ['PYOPENGL_PLATFORM'] = 'egl' could help, but in my case did not work.
Is there any other solution?

@MoralCode
Copy link

possibly also mcfletch/pyopengl#113

@hail-mary
Copy link
Author

Thanks for answering @MoralCode !
Rendering worked by simply adding os.environ['PYOPENGL_PLATFORM'] = 'glfw' in the python file.
However, I have faced

MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
fluidsynth: error: Failed to open the "default" audio device
ALSA lib seq_hw.c:528:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
fluidsynth: error: Error opening ALSA sequencer

It seems compatibility issues with the library designed for Linux like ALSA.
So it would be better to try on a native Ubuntu, but I would like to know if there is a smart way to work on Windows.

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