-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to load/find OpenGL on MacOS #1372
Comments
It looks like the issue is getting a fix python/cpython#21241 fullName = util.find_library( name ) to fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL' |
The fix to finding Python's cached sys dylibs is now tracked on this PR: It's currently in review. |
Thanks @asierralozano for finding that! |
Filed as internal issue #USD-6450 |
thx for answer, but my '/System/Library/Frameworks/OpenGL.framework' doesn't have a file named OpenGL |
You don't actually need the binary there, just change the fullName variable as suggested. |
It worked perfectly!! (mind the indentation when changing the line!!) |
better use
instead, as otherwise GLUT won't load. |
Can anyone tell me where is this file |
@zyf674 this worked for me
|
It looks like they have fixed this issue on the latest USD release! (21.02) |
I had the same issue but it also persisted with the GLUT framework as well. Below was my work around piggy backing off of suggested edits here. # fullName = util.find_library( name )
if "opengl" in name.lower():
fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL'
elif "glut" in name.lower():
fullName = '/System/Library/Frameworks/GLUT.framework/GLUT'
else:
fullName = util.find_library( name ) |
Hi, I cannot find the ctypesloader.py by |
Hi, you just need type "ctypesloader.py" in Spotlight Search. |
This works for me. Thanks |
Another option, if you can't (or don't want to) patch the library source, you can monkey-patch the stdlib ctypes library: def monkeypatch_ctypes():
import os
import ctypes.util
uname = os.uname()
if uname.sysname == "Darwin" and uname.release >= "20.":
real_find_library = ctypes.util.find_library
def find_library(name):
if name in {"OpenGL", "GLUT"}: # add more names here if necessary
return f"/System/Library/Frameworks/{name}.framework/{name}"
return real_find_library(name)
ctypes.util.find_library = find_library
return |
It should be here: |
This is exactly what I needed. 👍 |
@asierralozano |
@luca992 You are the hero I needed today, thank you for this monkey patch from last year! This solved my issues on Monterey using system Python 3.7.3, and a virtualenv where I install PyOpenGL. |
IGNORE ALL OF THESE JUST RUN THIS: |
Description of Issue
Hello!
I've installed USD on macOS Big Sur with this little fix, and although the build went successfully, as soon as I try to open USDView, it fails to load OpenGL
OpenGL is successfully installed. I'm able to import it with no problems on a python interpreter.
System Information (OS, Hardware)
macOS Big Sur Beta 10 (MacOS 11.0 Beta (20A5395g))
MacBookPro 2016 Late (i7)
Package Versions
USD v20.11
PyOpenGL v3.1.5
PySide2 v5.13.2
The text was updated successfully, but these errors were encountered: