Error occurred while running `from pyglet.gl import *` 해결하기
2021. 9. 8. 23:34ㆍ꿀팁 분석 환경 설정/파이썬 개발 팁
<ipython-input-4-f1e8f42adf6c> in get_screen()
12 # Returned screen requested by gym is 400x600x3, but is sometimes larger
13 # such as 800x1200x3. Transpose it into torch order (CHW).
---> 14 screen = env.render(mode='rgb_array').transpose((2, 0, 1))
15 # Cart is in the lower half, so strip off the top and bottom of the screen
16 _, screen_height, screen_width = screen.shape
/opt/conda/lib/python3.8/site-packages/gym/envs/classic_control/cartpole.py in render(self, mode)
177
178 if self.viewer is None:
--> 179 from gym.envs.classic_control import rendering
180
181 self.viewer = rendering.Viewer(screen_width, screen_height)
/opt/conda/lib/python3.8/site-packages/gym/envs/classic_control/rendering.py in <module>
27 from pyglet.gl import *
28 except ImportError as e:
---> 29 raise ImportError(
30 """
31 Error occurred while running `from pyglet.gl import *`
ImportError:
Error occurred while running `from pyglet.gl import *`
HINT: make sure you have OpenGL installed. 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>'
해결 방법
sudo apt-get update -y
sudo apt-get install -y python-opengl
728x90
'꿀팁 분석 환경 설정 > 파이썬 개발 팁' 카테고리의 다른 글
git add 시 파일 취소 방법 (0) | 2021.09.10 |
---|---|
NoSuchDisplayException: Cannot connect to "None" 해결하기 (0) | 2021.09.08 |
python) pip freeze에서 패키지 버전을 안보여주는 경우 (0) | 2021.09.06 |
vscode) line length 늘리기 (0) | 2021.09.05 |
Python) Database 관련 자료 (0) | 2021.09.04 |