question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not run on osx big sur

See original GitHub issue

When following this install tutorial and I get to the final step I get a stack trace with the following.

Traceback (most recent call last):
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/darwin.py", line 35, in GL
    return ctypesloader.loadLibrary(
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/ctypesloader.py", line 36, in loadLibrary
    return _loadLibraryWindows(dllType, name, mode)
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/ctypesloader.py", line 89, in _loadLibraryWindows
    return dllType( name, mode )
  File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ('dlopen(OpenGL, 10): image not found', 'OpenGL', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/owencraston/src/personal/python/coldtype/venv/bin/coldtype", line 33, in <module>
    sys.exit(load_entry_point('coldtype', 'console_scripts', 'coldtype')())
  File "/Users/owencraston/src/personal/python/coldtype/venv/bin/coldtype", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/owencraston/src/personal/python/coldtype/coldtype/renderer/__init__.py", line 31, in <module>
    from OpenGL import GL
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/GL/__init__.py", line 3, in <module>
    from OpenGL import error as _error
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/error.py", line 12, in <module>
    from OpenGL import platform, _configflags
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/__init__.py", line 36, in <module>
    _load()
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/__init__.py", line 33, in _load
    plugin.install(globals())
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 97, in install
    namespace[ name ] = getattr(self,name,None)
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 15, in __get__
    value = self.fget( obj )
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/darwin.py", line 62, in GetCurrentContext
    return self.CGL.CGLGetCurrentContext
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 15, in __get__
    value = self.fget( obj )
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/darwin.py", line 45, in CGL
    def CGL(self): return self.GL
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 15, in __get__
    value = self.fget( obj )
  File "/Users/owencraston/src/personal/python/coldtype/venv/lib/python3.9/site-packages/OpenGL/platform/darwin.py", line 41, in GL
    raise ImportError("Unable to load OpenGL library", *err.args)
ImportError: ('Unable to load OpenGL library', 'dlopen(OpenGL, 10): image not found', 'OpenGL', None)

This could very well be an issue with big sir but I thought i’d bring it up. I’m not exactly sure how to fix this since it seems like Opengl is deprecated on osx

I am running OSX 11.0.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
stensoncommented, May 27, 2021

also worth noting that without the [viewer] extra, coldtype doesn’t attempt to install any GL packages (glfw, OpenGl, skia-python), so the workaround might still be an issue but won’t come into play yet, unless you do append the [viewer] extra to the install line

1reaction
dubajjcommented, Dec 12, 2020

I ran into this same issue, it looks like its an issue in Python ctypes find_library that has already been fixed but not released. Here is a relevant stack overflow mention of this same problem: https://stackoverflow.com/questions/63475461/unable-to-import-opengl-gl-in-python-on-macos and it looks like bpo-41100: Support macOS 11 and Apple Silicon was merged a couple of days ago into python:master so that should be rolling out into a release pretty soonish.

Here is the rough work-around for the moment: in venv/lib/python3.9/site-packages/OpenGL/platform/ctypesloader.py change line 79 from fullName = util.find_library( name )

to

fullName = '/System/Library/Frameworks/OpenGL.framework/OpenGL';

Being on the bleeding edge OS wise means we hit some bumps of course as everyone else plays catch up along side. In this case we just have to wait a little bit for Python to fix this (the change above is NOT the fix its just a workaround)

When they drop an updated python with this fix be sure to delete and regenerate your venv.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

macOS 11 Big Sur problems: how to fix the most common issues
If you've installed macOS Big Sur, but your Mac won't start, then restart your Mac and hold down Command, Option, P and R,...
Read more >
How to Fix the Most Common macOS 11 Big Sur Issues
Restart your Mac. Restarting your Mac can solve the vast majority of issues, so this should always be the first fix to try....
Read more >
What to do when macOS Big Sur cannot be installed - MacPaw
What to do if the macOS Big Sur download is stuck · Check Apple's System Status page for information about possible server issues...
Read more >
Big Sur Problem?: "You do not have… - Apple Developer
Big Sur Problem?: "You do not have permission to open the application" · votes 18. Use this. It worked for me - codesign...
Read more >
macOS Big Sur issues and how to fix them - Setapp
macOS Big Sur won't install · Shut down your Mac · Hold down Option + Command + P + R for about 20...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found