2

I am running the examples provided by the PyQtGraph python graphic module, on a MacOS Catalina. They all work fine for me, except those in 3D. I have a message :

Traceback (most recent call last):
  File "/Applications/anaconda3/lib/python3.7/site-packages/pyqtgraph/examples/GLVolumeItem.py", line 11, in <module>
    import pyqtgraph.opengl as gl
  File "/Applications/anaconda3/lib/python3.7/site-packages/pyqtgraph/opengl/__init__.py", line 1, in <module>
    from .GLViewWidget import GLViewWidget
  File "/Applications/anaconda3/lib/python3.7/site-packages/pyqtgraph/opengl/GLViewWidget.py", line 2, in <module>
    from OpenGL.GL import *
ModuleNotFoundError: No module named 'OpenGL'

The OpenGL module, though deprecated in Catalina, is present at the location(I checked)

/System/Library/Frameworks/OpenGL.framework

but I have no clue about how to make python find it. Does anyone have ?

Thanks a lot !!

benwiggy
  • 35,635

1 Answers1

3

You need a python library, not the system framework.

The standard OpenGL python library is PyOpenGL. However, that seems to be different from the library requested by the code.

If you installed PyQtGraph correctly, that should install everything you need.

benwiggy
  • 35,635
  • Thank you for your answer. I first installed PyQtGraph via conda, with the negative result I explain in the question. I then tried reinstall it with pip, then pip3, with exactly the same error... :/ – Richard Taillet Jun 21 '20 at 15:38
  • OK, I installed PyOpenGL and now the error message disappear and the example does run (not all of of them but one problem at a time). Thanks a lot for your help ! – Richard Taillet Jun 21 '20 at 15:42
  • In this case the op.iz using anaconda so use conda to set up an environment and the python packages needed. Don't use pip or venv – mmmmmm Jun 21 '20 at 21:20