简体   繁体   English

在 macOS Big Sur 上安装 PyOpenGL

[英]PyOpenGL installation on macOS Big Sur

I am trying to install PyOpenGL on my MacBook Pro 16" for distant studies at university. I am running macOS Big Sur however I read that this OS version could cause problems with OpenGL.我正在尝试在我的 MacBook Pro 16" 上安装 PyOpenGL,以便在大学进行远程学习。我正在运行 macOS Big Sur 但是我读到此操作系统版本可能会导致 OpenGL 出现问题。

I have tried this command for the installation:我试过这个命令进行安装:

pip3 install PyOpenGL PyOpenGL_accelerate

Everything seems to be correctly installed in my python packages.一切似乎都正确安装在我的 python 包中。 But when I try to import the necessary packages in python3 with this command: from OpenGL.GLUT import * I get a strange error.但是当我尝试使用以下命令在 python3 中导入必要的包时: from OpenGL.GLUT import *我收到一个奇怪的错误。

在此处输入图像描述

I have searched on internet, but I couldn't find any recent and working installation process.我在互联网上进行了搜索,但找不到任何最近且有效的安装过程。

Thank you in advance for your help.预先感谢您的帮助。

Thomas.托马斯。

See the: Unable to import opengl.gl in python on macos Check the second answer (the first will only fix OpenGL.GL but not OpenGL.GLUT). See the: Unable to import opengl.gl in python on macos Check the second answer (the first will only fix OpenGL.GL but not OpenGL.GLUT).

You need to set:你需要设置:

fullName = "/System/Library/Frameworks/{}.framework/{}".format(name,name) fullName = "/System/Library/Frameworks/{}.framework/{}".format(name,name)

in the file OpenGL/platform/ctypesloader.py (the exact absolute location depends on your installation).在文件 OpenGL/platform/ctypesloader.py 中(确切的绝对位置取决于您的安装)。

Yuval.尤瓦尔。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM