mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-23 15:04:20 +00:00
remove reraise logic (#1342)
* remove reraise logic - replace with re-raising import errors in the only place it is used * remove reraise * remove reset call from MountainCar constructor * further remove reraise * remove reraise import in classic_control/rendering.py
This commit is contained in:
@@ -11,18 +11,27 @@ if "Apple" in sys.version:
|
||||
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:
|
||||
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.")
|
||||
raise ImportError('''
|
||||
Cannot import pyglet.
|
||||
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:
|
||||
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>'")
|
||||
raise ImportError('''
|
||||
Error occured 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>'
|
||||
''')
|
||||
|
||||
import math
|
||||
import numpy as np
|
||||
|
Reference in New Issue
Block a user