栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

2021-10-23 python搭建opengl环境问题:PyOpenGL is already installed with the same version as the provided wh

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

2021-10-23 python搭建opengl环境问题:PyOpenGL is already installed with the same version as the provided wh

以下记录安装过程中遇到的错误,文章最后处附完整的安装流程。

遇到的错误:

PyOpenGL is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.

问题解决:

找到的参考网页如下:

https://www.it1352.com/2325333.html

我的解决步骤:

1、命令行中输入
pip uninstall pyopengl
卸载原来的版本

2、然后在PyOpenGL_xxxxx.whl文件所在目录下执行
pip install PyOpenGL‑3.1.5‑cp39‑cp39‑win_amd64.whl
( 删除线部分根据python版本不同而不同)
安装成功。

3、用import来测试,出现了新的错误:
No module named ‘OpenGL’

4、经过检查发现是因为我的电脑之前安装的aniconda对应的是python的3.8版本,但我的python是3.7版本的。
版本不一致导致了以上的错误(我下载了3.8版本的wheel但是用的却是3.7版本的python)
于是我将miniconda卸载了,然后下载了3.7版本的wheel
(或者也可以尝试下载3.8版本的python)
再重新使用如下命令安装就成功啦
pip install PyOpenGL-3.1.5-cp37-cp37m-win_amd64.whl

5、测试:在python中import OpenGL出现如下就说明成功啦

附:完整的安装流程

参考链接:
https://blog.csdn.net/qq_32159463/article/details/99459558

我的具体安装步骤:
1、链接:https://www.lfd.uci.edu/~gohlke/pythonlibs/
找到PyOpenGL,选择python3.7的64位文件下载(根据你的python版本选择)

2、在PyOpenGL_xxxxx.whl文件所在目录下执行
pip install XXX.whl

3、测试:在python中import OpenGL出现如下就说明成功啦

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/444351.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号