1

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
Connor
  • 193
  • 1
  • 11
  • 1
    Possible duplicate of [Configure pyglfw](http://stackoverflow.com/questions/34632537/configure-pyglfw) – John Y Dec 29 '16 at 20:09
  • @JohnY I have tried that but the solutions don't appear to work for me. To clarify, I moved the glfw3.dll file into the SysWOW64 folder and changed how the library is loaded in the glfw.py module and still have no luck. – Connor Dec 29 '16 at 20:19
  • Incidentally, there are quite a number of Python bindings for GLFW. If I had to choose one today, it would probably be [this one](https://pypi.python.org/pypi/glfw) (which isn't the one covered by the question I linked to). But I don't use GLFW, so I don't have any tips of my own to offer. – John Y Dec 29 '16 at 20:24
  • @JohnY That is actually the one I am trying to use as well. However, you need to download the DLLs separately from http://www.glfw.org/download.html and that seems to be the part I am screwing up, as the python binding can't load the libraries. – Connor Dec 29 '16 at 20:46

1 Answers1

2

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.

Connor
  • 193
  • 1
  • 11