Reputation: 41
I am having trouble using the pg module in my code. I've installed it using pip. But when I go to run it I get the following error:
Traceback (most recent call last):
File "Contract_gen.py", line 2, in <module>
import pg
File "C:\Python27\lib\site-packages\pg\__init__.py", line 1, in <module>
from .core import (
File "C:\Python27\lib\site-packages\pg\core.py", line 6, in <module>
from . import glfw
File "C:\Python27\lib\site-packages\pg\glfw.py", line 140, in <module>
raise ImportError("Failed to load GLFW3 shared library.")
ImportError: Failed to load GLFW3 shared library.
Upvotes: 2
Views: 5207
Reputation: 168
How to solve for windows:
For me, glfw was working fine until one morning when it suddenly wasn't. This solution worked for me. I don't know if this is the correct way to solve it but it worked for me.
Upvotes: 0
Reputation: 74
Your version of OpenGL might be too old compared to the pg requirement which is 3.1.0 as specified in https://github.com/fogleman/pg/blob/master/requirements.txt
You can re install python-openGL with pip:
$ pip install PyOpenGL PyOpenGL_accelerate
This removes this problem but creates other errors for me.
note, besides, that this problem seems to be mentioned in https://github.com/fogleman/pg/issues
Upvotes: 0
Reputation: 1258
It seems like to require the GLFW3
library. Download & install it and the error should be gone. If you use macOS you can get it via brew
.
Upvotes: 3