Using GLFW in Python on Windows

3.5k views Asked by At

Is there an easy way to use GLFW in python? I have tried installing pyglfw and wasn't able to import the modules inside of the pyglfw package. I also tried installing glfw, but got the following error while trying to import it:

ImportError: Failed to load GLFW3 shared library.

I then tried downloading glfw and placing the glfw3.dll file in the same directory as glfw.py but had no luck. I am not very experienced with python imports or shared libraries, so its likely I made a mistake here.

Any advice would be greatly appreciated!

Edit: If it is any help, the following is the message given by the OSError exception:

[WinError 193] %1 is not a valid Win32 application
1

There are 1 answers

0
Connor On BEST ANSWER

Solved by moving the lib-mingw folder obtained here into the same directory as glfw.py and then modifying glfw.py to load the DLL using the absolute path.