ModuleNotFoundError Traceback (most recent call last)
File D:\ProgramData\anaconda3\envs\jqxx\lib\site-packages\gym\envs\box2d\bipedal_walker.py:14
13 try:
---> 14 import Box2D
15 from Box2D.b2 import (
16 circleShape,
17 contactListener,
(...)
21 revoluteJointDef,
22 )
ModuleNotFoundError: No module named 'Box2D'
During handling of the above exception, another exception occurred:
DependencyNotInstalled Traceback (most recent call last)
Cell In[2], line 1
----> 1 env = gym.make('LunarLander-v2')
2 env.seed(0)
3 print('State shape: ', env.observation_space.shape)
File D:\ProgramData\anaconda3\envs\jqxx\lib\site-packages\gym\envs\registration.py:581, in make(id, max_episode_steps, autoreset, apply_api_compatibility, disable_env_checker, **kwargs)
578 env_creator = spec_.entry_point
579 else:
580 # Assume it's a string
--> 581 env_creator = load(spec_.entry_point)
583 mode = _kwargs.get("render_mode")
584 apply_human_rendering = False
File D:\ProgramData\anaconda3\envs\jqxx\lib\site-packages\gym\envs\registration.py:61, in load(name)
52 """Loads an environment with name and returns an environment creation function
53
54 Args:
(...)
58 Calls the environment constructor
59 """
60 mod_name, attr_name = name.split(":")
---> 61 mod = importlib.import_module(mod_name)
62 fn = getattr(mod, attr_name)
63 return fn
File D:\ProgramData\anaconda3\envs\jqxx\lib\importlib\__init__.py:127, in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1030, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1007, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:972, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:228, in _call_with_frames_removed(f, *args, **kwds)
File <frozen importlib._bootstrap>:1030, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1007, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:986, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:680, in _load_unlocked(spec)
File <frozen importlib._bootstrap_external>:850, in exec_module(self, module)
File <frozen importlib._bootstrap>:228, in _call_with_frames_removed(f, *args, **kwds)
File D:\ProgramData\anaconda3\envs\jqxx\lib\site-packages\gym\envs\box2d\__init__.py:1
----> 1 from gym.envs.box2d.bipedal_walker import BipedalWalker, BipedalWalkerHardcore
2 from gym.envs.box2d.car_racing import CarRacing
3 from gym.envs.box2d.lunar_lander import LunarLander, LunarLanderContinuous
File D:\ProgramData\anaconda3\envs\jqxx\lib\site-packages\gym\envs\box2d\bipedal_walker.py:24
15 from Box2D.b2 import (
16 circleShape,
17 contactListener,
(...)
21 revoluteJointDef,
22 )
23 except ImportError:
---> 24 raise DependencyNotInstalled("box2D is not installed, run `pip install gym[box2d]`")
27 if TYPE_CHECKING:
28 import pygame
DependencyNotInstalled: box2D is not installed, run `pip install gym[box2d]`
最新发布