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

ImportError: Unable to load OpenGL library #160

Open
porwal97 opened this issue Mar 14, 2022 · 5 comments
Open

ImportError: Unable to load OpenGL library #160

porwal97 opened this issue Mar 14, 2022 · 5 comments
Labels
bug Something isn't working platform: macos

Comments

@porwal97
Copy link

porwal97 commented Mar 14, 2022

Computer: MacOS Monterey
Python Version: 3.7.11
Jupyter Notebook Version: 6.3.0
Brain Interface Used: Cyton+Daisy

I am trying to Test if the Python library installed correctly by using the code:

from eegnb import generate_save_fn
from eegnb.devices.eeg import EEG
from eegnb.experiments.visual_n170 import n170

I get the following ImportError. Any advice on how to fix this?

ImportError: ('Unable to load OpenGL library', "dlopen(OpenGL, 0x000A): tried: '/opt/anaconda3/envs/eeg-notebooks/lib/OpenGL' (no such file), '/opt/anaconda3/envs/eeg-notebooks/lib/OpenGL' (no such file), '/opt/anaconda3/envs/eeg-notebooks/lib/python3.7/lib-dynload/../../OpenGL' (no such file), '/opt/anaconda3/envs/eeg-notebooks/lib/OpenGL' (no such file), '/opt/anaconda3/envs/eeg-notebooks/bin/../lib/OpenGL' (no such file), 'OpenGL' (no such file), '/usr/local/lib/OpenGL' (no such file), '/usr/lib/OpenGL' (no such file), '/Users/priyanshiporwal/eeg-notebooks/OpenGL' (no such file), '/usr/local/lib/OpenGL' (no such file), '/usr/lib/OpenGL' (no such file)", 'OpenGL', None)

@Zaduk
Copy link

Zaduk commented Mar 15, 2022

Same here, I've been getting the same issue, with the exact same specs as @porwal97. Note: I use an ARM MacBook Air. I've read the main SO article for this error (https://stackoverflow.com/questions/63475461/unable-to-import-opengl-gl-in-python-on-macos) and followed the recommended answer. I've tried changing it to my actual path in my own file system, but nothing.

@JohnGriffiths
Copy link
Collaborator

Hi @porwal97 @Zaduk .

Thanks for the feedback and your interest in eeg-notebooks.

I will try to look into this problem, but unfortunately don't have access to an ARM Mac system for testing.

All of the OpenGL functionality in eeg-notebooks is 'indirect', i.e. it is via Psychopy. I don't see the full stack trace from @porwal97 's Import Error, but I would guess it is a from psychopy import visual, core line. The best help you can get on that issue will be from the Psychopy forum. I recommend post on there the incriminating Psychopy line, plus your OS information.

Definitely keep us posted here on how this goes!

@ErikBjare
Copy link
Collaborator

ErikBjare commented Mar 25, 2022

I had the same issue in CI: https://github.com/NeuroTechX/eeg-notebooks/runs/5690930290

I updated PsychoPy to the latest version in #167, which solved the issue.

Note however that:

  1. In its place there's a new issue, but there's a known workaround: Trouble installing on osx "fatal error: 'al.h' file not found" bambocher/pocketsphinx-python#28
  2. You now also need Python >=3.8

@pjkohler
Copy link

Commenting here to say that I also have issues with OpenGL on a recent (M1) MacBook Air, I assume it is for similar reasons. So if instructions materialize on how to get it working on this type of machine, I would love to see them.

@Zaduk
Copy link

Zaduk commented Apr 5, 2022

Update: I installed Xcode and it solved the issue for me. I've won, but at what cost...

@ErikBjare ErikBjare added bug Something isn't working platform: macos labels Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: macos
Projects
None yet
Development

No branches or pull requests

5 participants