python如何下载安装glfw_在Eclipse中为Python配置glfw

使用Python绑定glfw进行OpenGL窗口显示时遇到问题,错误提示找不到GLFW共享库。尝试手动下载pyglfw的.pyd文件和dll,但未成功。解决方案是通过pip安装pyglfw模块,这将自动处理下载、构建和安装过程,避免手动配置路径。
摘要由CSDN通过智能技术生成

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:\Users\Zolani\workspace\PyGLCanvas\main\main.py", line 1, in

import glfw

File "C:\Users\Zolani\Desktop\pyglfw-main\pyglfw-master\glfw\__init__.py", line 395, in

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?

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值