error: No module named 'snappy.CyOpenGL'
Closed this issue · 5 comments
Having installed Snappy on Ubuntu (16.04 with python 3.9) as outlined in documentation,
I get the following error on starting it (~/.local/bin/SnapPy):
Traceback (most recent call last):
File "~/.local/bin/SnapPy", line 5, in <module>
from snappy.app import main
File "~/.local/lib/python3.9/site-packages/snappy/app.py", line 17, in <module>
from .browser import Browser
File "~/.local/lib/python3.9/site-packages/snappy/browser.py", line 6, in <module>
from .polyviewer import PolyhedronViewer
File "~/.local/lib/python3.9/site-packages/snappy/polyviewer.py", line 6, in <module>
from .CyOpenGL import *
ModuleNotFoundError: No module named 'snappy.CyOpenGL'
It sounds like you are building SnapPy from source and you don't have an opengl development package installed on your system. Did you run
python3 -m pip install --upgrade --user pip wheel
as it says in the instructions? You might try upgrading setuptools as well.
Yes, I did run this and the other commands as it says in the instructions.
Setuptools is upgraded as well.
However, the error stays the same.
Isn't it that the missing CyOpenGL module is supposed to be a module of Snappy as the code in polyviewer.py suggests?
This is the error one gets when SnapPy was built from the source tarball but certain OpenGL header files are missing. Hence it was unable to build CyOpenGL. Two possible fixes:
First, you can try uninstalling and forcing it to use the binary wheel:
python3 -m pip uninstall snappy
python3 -m pip install --only-binary snappy --user snappy
Second, you can install the missing header files and rebuild:
sudo apt-get install libglu1-mesa-dev
python3 -m pip uninstall snappy
python3 -m pip install --no-binary snappy --user snappy
Let us know if either works for you.
Ok,
the first approach yields
ERROR: Could not find a version that satisfies the requirement snappy
ERROR: No matching distribution found for snappy
The second, however, works
(remark: libglu1-mesa-dev was installed already; so, crucial has been the command
python3 -m pip install --no-binary snappy --user snappy
).
Thank you very much.