无法使用 OpenGL 找到渲染

问题描述 投票:0回答:1

我正在使用 Mac,并尝试从 open ai 的健身房渲染环境

import gym
env= gym.make('CartPole-v1')
img = env.render()
ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework.

During handling of the above exception, another exception occurred:

ImportError: 
    Error occurred while running `from pyglet.gl import *`
    HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'.
    If you're running on a server, you may need a virtual frame buffer; something like this should work:
    'xvfb-run -s "-screen 0 1400x900x24" python <your_script.py>'

尽管事实上,当我导航到该目录(Framewords)时,我可以直接看到 OpenGL.framework

有人遇到过这个吗?

python opengl reinforcement-learning openai-gym
1个回答
0
投票

正如线程中指出的,尝试:

pip install pyglet==1.5.11
© www.soinside.com 2019 - 2024. All rights reserved.