Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update requirement list and add quotes around pip install for macos users #1001

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gymnasium/envs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
# --- For shimmy compatibility
def _raise_shimmy_error(*args: Any, **kwargs: Any):
raise ImportError(
"To use the gym compatibility environments, run `pip install shimmy[gym-v21]` or `pip install shimmy[gym-v26]`"
'To use the gym compatibility environments, run `pip install "shimmy[gym-v21]"` or `pip install "shimmy[gym-v26]"`'
)


Expand Down
4 changes: 2 additions & 2 deletions gymnasium/envs/box2d/bipedal_walker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)
except ImportError as e:
raise DependencyNotInstalled(
"Box2D is not installed, run `pip install gymnasium[box2d]`"
'Box2D is not installed, run `pip install "gymnasium[box2d]"`'
) from e


Expand Down Expand Up @@ -628,7 +628,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[box2d]`"
'pygame is not installed, run `pip install "gymnasium[box2d]"`'
) from e

if self.screen is None and self.render_mode == "human":
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/box2d/car_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from Box2D.b2 import fixtureDef, polygonShape, revoluteJointDef
except ImportError as e:
raise DependencyNotInstalled(
"Box2D is not installed, run `pip install gymnasium[box2d]`"
'Box2D is not installed, run `pip install "gymnasium[box2d]"`'
) from e


Expand Down
4 changes: 2 additions & 2 deletions gymnasium/envs/box2d/car_racing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from Box2D.b2 import contactListener, fixtureDef, polygonShape
except ImportError as e:
raise DependencyNotInstalled(
"Box2D is not installed, run `pip install gymnasium[box2d]`"
'Box2D is not installed, run `pip install "gymnasium[box2d]"`'
) from e

try:
Expand All @@ -27,7 +27,7 @@
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[box2d]`"
'pygame is not installed, run `pip install "gymnasium[box2d]"`'
) from e


Expand Down
4 changes: 2 additions & 2 deletions gymnasium/envs/box2d/lunar_lander.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
)
except ImportError as e:
raise DependencyNotInstalled(
"Box2D is not installed, run `pip install gymnasium[box2d]`"
'Box2D is not installed, run `pip install "gymnasium[box2d]"`'
) from e


Expand Down Expand Up @@ -683,7 +683,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[box2d]`"
'pygame is not installed, run `pip install "gymnasium[box2d]"`'
) from e

if self.screen is None and self.render_mode == "human":
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/classic_control/acrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic-control]"`'
) from e

if self.screen is None:
Expand Down
4 changes: 2 additions & 2 deletions gymnasium/envs/classic_control/cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic-control]"`'
) from e

if self.screen is None:
Expand Down Expand Up @@ -528,7 +528,7 @@ def render(self):
from pygame import gfxdraw
except ImportError:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic_control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
)

if self.screens is None:
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/classic_control/continuous_mountain_car.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e

if self.screen is None:
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/classic_control/mountain_car.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e

if self.screen is None:
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/classic_control/pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def render(self):
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e

if self.screen is None:
Expand Down
3 changes: 1 addition & 2 deletions gymnasium/envs/mujoco/mujoco_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import mujoco
except ImportError as e:
raise error.DependencyNotInstalled(
"Could not import mujoco"
"(HINT: you need to install mujoco, run `pip install gymnasium[mujoco]`.)"
'MuJoCo is not installed, run `pip install "gymnasium[mujoco]"`'
) from e


Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/phys2d/cartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def render_image(
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e
screen, clock = render_state

Expand Down Expand Up @@ -217,7 +217,7 @@ def render_init(
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e

pygame.init()
Expand All @@ -232,7 +232,7 @@ def render_close(self, render_state: RenderStateType) -> None:
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e
pygame.display.quit()
pygame.quit()
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/phys2d/pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def render_image(
from pygame import gfxdraw
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e
screen, clock, last_u = render_state

Expand Down Expand Up @@ -191,7 +191,7 @@ def render_init(
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e

pygame.init()
Expand All @@ -210,7 +210,7 @@ def render_close(
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e
pygame.display.quit()
pygame.quit()
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/tabular/blackjack.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def render_init(
import pygame
except ImportError:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic_control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
)

rng = seeding.np_random(0)[0]
Expand All @@ -377,7 +377,7 @@ def render_image(
import pygame
except ImportError:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy_text]`"
'pygame is not installed, run `pip install "gymnasium[toy_text]"`'
)
screen, dealer_top_card_value_str, dealer_top_card_suit = render_state

Expand Down Expand Up @@ -483,7 +483,7 @@ def render_close(self, render_state: RenderStateType) -> None:
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic_control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e
pygame.display.quit()
pygame.quit()
Expand Down
6 changes: 3 additions & 3 deletions gymnasium/envs/tabular/cliffwalking.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def render_init(
import pygame
except ImportError:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic_control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
)

cell_size = (60, 60)
Expand Down Expand Up @@ -302,7 +302,7 @@ def render_image(
import pygame
except ImportError:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy_text]`"
'pygame is not installed, run `pip install "gymnasium[toy_text]"`'
)
(
window_surface,
Expand Down Expand Up @@ -349,7 +349,7 @@ def render_close(self, render_state: RenderStateType) -> None:
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy-text]`"
'pygame is not installed, run `pip install "gymnasium[toy-text]"`'
) from e
pygame.display.quit()
pygame.quit()
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/toy_text/blackjack.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def render(self):
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy-text]`"
'pygame is not installed, run `pip install "gymnasium[toy-text]"`'
) from e

player_sum, dealer_card_value, usable_ace = self._get_obs()
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/toy_text/cliffwalking.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _render_gui(self, mode):
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy-text]`"
'pygame is not installed, run `pip install "gymnasium[toy-text]"`'
) from e
if self.window_surface is None:
pygame.init()
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/toy_text/frozen_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def _render_gui(self, mode):
import pygame
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy-text]`"
'pygame is not installed, run `pip install "gymnasium[toy-text]"`'
) from e

if self.window_surface is None:
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/toy_text/taxi.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def _render_gui(self, mode):
import pygame # dependency to pygame only if rendering with human
except ImportError as e:
raise DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[toy-text]`"
'pygame is not installed, run `pip install "gymnasium[toy-text]"`'
) from e

if self.window is None:
Expand Down
8 changes: 4 additions & 4 deletions gymnasium/utils/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pygame.event import Event
except ImportError as e:
raise gym.error.DependencyNotInstalled(
"pygame is not installed, run `pip install gymnasium[classic-control]`"
'pygame is not installed, run `pip install "gymnasium[classic_control]"`'
) from e

try:
Expand All @@ -27,7 +27,7 @@
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
except ImportError:
logger.warn("matplotlib is not installed, run `pip install gymnasium[other]`")
logger.warn('matplotlib is not installed, run `pip install "gymnasium[other]"`')
matplotlib, plt = None, None


Expand Down Expand Up @@ -358,7 +358,7 @@ def __init__(

if plt is None:
raise DependencyNotInstalled(
"matplotlib is not installed, run `pip install gymnasium[other]`"
'matplotlib is not installed, run `pip install "gymnasium[other]"`'
)

num_plots = len(self.plot_names)
Expand Down Expand Up @@ -411,6 +411,6 @@ def callback(

if plt is None:
raise DependencyNotInstalled(
"matplotlib is not installed, run `pip install gymnasium[other]`"
'matplotlib is not installed, run `pip install "gymnasium[other]"`'
)
plt.pause(0.000001)
2 changes: 1 addition & 1 deletion gymnasium/utils/save_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from moviepy.video.io.ImageSequenceClip import ImageSequenceClip
except ImportError as e:
raise gym.error.DependencyNotInstalled(
"moviepy is not installed, run `pip install moviepy`"
'moviepy is not installed, run `pip install "gymnasium[other]"`'
) from e


Expand Down
2 changes: 1 addition & 1 deletion gymnasium/wrappers/atari_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
import cv2 # noqa: F401
except ImportError:
raise gym.error.DependencyNotInstalled(
"opencv-python package not installed, run `pip install gymnasium[other]` to get dependencies for atari"
'opencv-python package not installed, run `pip install "gymnasium[other]"` to get dependencies for atari'
)

assert frame_skip > 0
Expand Down
4 changes: 2 additions & 2 deletions gymnasium/wrappers/jax_to_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import jax.numpy as jnp
except ImportError:
raise DependencyNotInstalled(
"Jax is not installed therefore cannot call `numpy_to_jax`, run `pip install gymnasium[jax]`"
'Jax is not installed therefore cannot call `numpy_to_jax`, run `pip install "gymnasium[jax]"`'
)

__all__ = ["JaxToNumpy", "jax_to_numpy", "numpy_to_jax"]
Expand Down Expand Up @@ -145,7 +145,7 @@ def __init__(self, env: gym.Env[ObsType, ActType]):
"""
if jnp is None:
raise DependencyNotInstalled(
"jax is not installed, run `pip install gymnasium[jax]`"
'Jax is not installed, run `pip install "gymnasium[jax]"`'
)
gym.utils.RecordConstructorArgs.__init__(self)
gym.Wrapper.__init__(self, env)
Expand Down
4 changes: 2 additions & 2 deletions gymnasium/wrappers/jax_to_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from jax import dlpack as jax_dlpack
except ImportError:
raise DependencyNotInstalled(
"Jax is not installed therefore cannot call `torch_to_jax`, run `pip install gymnasium[jax]`"
'Jax is not installed therefore cannot call `torch_to_jax`, run `pip install "gymnasium[jax]"`'
)

try:
Expand All @@ -36,7 +36,7 @@
Device = Union[str, torch.device]
except ImportError:
raise DependencyNotInstalled(
"Torch is not installed therefore cannot call `torch_to_jax`, run `pip install torch`"
'Torch is not installed therefore cannot call `torch_to_jax`, run `pip install "gymnasium[torch]"`'
)


Expand Down
2 changes: 1 addition & 1 deletion gymnasium/wrappers/numpy_to_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Device = Union[str, torch.device]
except ImportError:
raise DependencyNotInstalled(
"Torch is not installed therefore cannot call `torch_to_numpy`, run `pip install torch`"
'Torch is not installed therefore cannot call `torch_to_numpy`, run `pip install "gymnasium[torch]"`'
)


Expand Down
Loading
Loading