PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl 在此平台上不受支持
PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform
对于 Python 项目,我需要 PyOpenGL。我用 PyCharm IDE 安装了它。
当我 运行 一个 OpenGL 程序来测试安装时,出现以下错误消息:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling.
我在 www 上搜索了可能的解决方案,并且在 Whosebug 上找到了一些。我尝试了所有这些并且 none 成功了。
然后我在这里找到了那个博客:
https://block.arch.ethz.ch/blog/2016/10/pyopengl-glut-error/
我按照所有说明操作并在 PyCharm IDE 中收到以下错误消息:
(virtual-environment) C:\Users\Rainer\PycharmProjects\MatchMover>pip install C:\Users\Rainer\Desktop\PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl
PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
You are using pip version 9.0.1, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
pip包已手动更新到20.0.2版本,但与PyCharmIDE不同步。
我用的是Windows7电脑,Python3.6.3,PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl 作为 OpenGL 库我使用 freeglut.
这里是测试程序(摘自:https://codeloop.org/python-opengl-programming-creating-window/):
main.py
from OpenGL.GL import *
from OpenGL.GLUT import *
width, height = 500, 400
def draw():
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glutSwapBuffers()
glutInit()
glutInitDisplayMode(GLUT_RGBA )
glutInitWindowSize(width, height)
glutInitWindowPosition(200, 200)
window = glutCreateWindow("Opengl Window In Python")
glutDisplayFunc(draw)
glutIdleFunc(draw)
glutMainLoop()
此错误的两个常见来源是……
- 软件包需要不同的系统类型(32 位与 64 位)。
- 系统没有或无法识别 Python 的必要版本,即有人只安装了 3.x 版本,但软件包需要 Python 2.7.
但是正如你所说,你有 python 3.6 所以我会把解决方案作为第一个选项。
解决方法是下载其他版本(如果您下载的是 64 位,则为 32 位,反之亦然),或者如果您知道自己需要现有版本,则更改方向盘的文件名。
对于 Python 项目,我需要 PyOpenGL。我用 PyCharm IDE 安装了它。
当我 运行 一个 OpenGL 程序来测试安装时,出现以下错误消息:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling.
我在 www 上搜索了可能的解决方案,并且在 Whosebug 上找到了一些。我尝试了所有这些并且 none 成功了。
然后我在这里找到了那个博客:
https://block.arch.ethz.ch/blog/2016/10/pyopengl-glut-error/
我按照所有说明操作并在 PyCharm IDE 中收到以下错误消息:
(virtual-environment) C:\Users\Rainer\PycharmProjects\MatchMover>pip install C:\Users\Rainer\Desktop\PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl
PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
You are using pip version 9.0.1, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
pip包已手动更新到20.0.2版本,但与PyCharmIDE不同步。
我用的是Windows7电脑,Python3.6.3,PyOpenGL-3.1.5-cp36-cp36m-win_amd64.whl 作为 OpenGL 库我使用 freeglut.
这里是测试程序(摘自:https://codeloop.org/python-opengl-programming-creating-window/):
main.py
from OpenGL.GL import *
from OpenGL.GLUT import *
width, height = 500, 400
def draw():
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glutSwapBuffers()
glutInit()
glutInitDisplayMode(GLUT_RGBA )
glutInitWindowSize(width, height)
glutInitWindowPosition(200, 200)
window = glutCreateWindow("Opengl Window In Python")
glutDisplayFunc(draw)
glutIdleFunc(draw)
glutMainLoop()
此错误的两个常见来源是……
- 软件包需要不同的系统类型(32 位与 64 位)。
- 系统没有或无法识别 Python 的必要版本,即有人只安装了 3.x 版本,但软件包需要 Python 2.7.
但是正如你所说,你有 python 3.6 所以我会把解决方案作为第一个选项。
解决方法是下载其他版本(如果您下载的是 64 位,则为 32 位,反之亦然),或者如果您知道自己需要现有版本,则更改方向盘的文件名。