问题描述
我正在尝试在Windows 10上使用pip安装PyOpenGL.
我尝试使用pip install PyOpenGL安装它,并告诉我它已成功安装,但是当我尝试在python中使用PyOpenGL时,它告诉我没有名为PyOpenGL的模块.你知道是什么问题吗?
I am trying to install PyOpenGL using pip on Windows 10.
I have tried to install it using pip install PyOpenGL and it tells me that it has installed it successfully but when I try to use PyOpenGL in python, it tells me that I do not have a module named PyOpenGL. Do you know what the problem is?
推荐答案
转到非官方适用于Python扩展程序包的Windows二进制文件
下载32位或64位程序包以获取 PyOpenGL提供与OpenGL的绑定, GLUT和GLE
(例如
PyOpenGL-3.1.5-cp38-cp38-win_amd64.whl 和
PyOpenGL_accelerate-3.1.5-cp38-cp38-win_amd64.whl )
Download a 32 bit or 64 bit package for PyOpenGL provides bindings to OpenGL, GLUT, and GLE
(e.g.
PyOpenGL-3.1.5-cp38-cp38-win_amd64.whl and
PyOpenGL_accelerate-3.1.5-cp38-cp38-win_amd64.whl)
以管理员身份打开命令提示符(cmd.exe).转到下载目录并通过pip install packagename.whl
安装软件包.
Open Command Prompt (cmd.exe) as administrator. Change to the download directory and install the packages by pip install packagename.whl
.
例如:
pip install PyOpenGL-3.1.5-cp38-cp38-win_amd64.whl
和
pip install PyOpenGL_accelerate-3.1.5-cp38-cp38-win_amd64.whl
如果该软件包已经安装但无法使用,则必须通过选项--ignore-installed
忽略当前安装的软件包:
If the package is already installed, but doesn't work, then you have to ignore the currently installed package, by the option --ignore-installed
:
pip install --ignore-installed PyOpenGL-3.1.5-cp38-cp38-win_amd64.whl
pip install --ignore-installed PyOpenGL_accelerate-3.1.5-cp38-cp38-win_amd64.whl
这篇关于需要安装PyOpenGL(Windows)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!