Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

opengl - Configuring glfw for Python in Eclipse

I'm trying to get OpenGL to work with Python. I'm using a python binding of glfw to display the window/configure the keyboard and such.

The Sourceforge page for pyglfw has a download link containing a .pyd file and a dll. On the git page, pyglfw contains a bunch of folders.

I downloaded both, and referenced them with PyDev in Eclipse, in the Eclipse "External Libraries" section. I wrote some code:

import glfw

glfw.Init();

if (glfw.OpenWindow(800, 600, 5, 6, 5, 0, 8, 0, glfw.FULLSCREEN) != True):
    glfw.Terminate(); # calls glfwTerminate() and exits
    glfw.SetWindowTitle("The GLFW Window");

And received this error

Traceback (most recent call last):
  File "C:UsersolaniworkspacePyGLCanvasmainmain.py", line 1, in <module>
    import glfw 
  File "C:UsersolaniDesktoppyglfw-mainpyglfw-masterglfw\__init__.py", line 395,     in <module>
    raise RuntimeError("no GLFW shared library found")
RuntimeError: no GLFW shared library found

I'm not sure what it's unable to find that it won't run. If I'm referencing the wrong directories within one of these folders, which ones do I need to reference in Eclipse's external library for it to find what it needs?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Python modules must be installed in the right directories. Usually $PYTHON/site-packages/…. However why bother with doing all this manually. pyglfw is available through PIP.

pip install pyglfw takes care of downloading, building and installing the module.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...