Skip to content

Commit

Permalink
Use our reraising when probing for pyglet
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschneider committed May 2, 2016
1 parent 6acd9e5 commit e74ed45
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gym/envs/classic_control/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] += ':/usr/lib'
# (JDS 2016/04/15): avoid bug on Anaconda 2.3.0 / Yosemite

from gym.utils import reraise
from gym import error

try:
import pyglet
except ImportError as e:
raise error.DependencyNotInstalled("""{}
(HINT: you can install pyglet directly via 'pip install pyglet'. But if you really just want to install all Gym dependencies and not have to think about it, 'pip install -e .[all]' or 'pip install gym[all]' will do it.)""".format(e))
reraise(suffix="HINT: you can install pyglet directly via 'pip install pyglet'. But if you really just want to install all Gym dependencies and not have to think about it, 'pip install -e .[all]' or 'pip install gym[all]' will do it.")

try:
from pyglet.gl import *
except ImportError as e:
raise error.DependencyNotInstalled("""{} (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" <your script here>')""".format(e))
reraise(prefix="Error occured while running `from pyglet.gl import *`",suffix="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>'")

import math
import numpy as np
Expand Down

0 comments on commit e74ed45

Please sign in to comment.