我只是想运行这个简单的试验代码:
import gym
env = gym.make('SpaceInvaders-v0')
env.reset()
for _ in range(1000):
env.step(env.action_space.sample())
env.render('human')
env.close()
我遇到了一个错误,报告如下:
Traceback (most recent call last): File "C:\Users\91920\ML\ReinforcementLearning\space_invaders.py", line 2, in <module>
env = gym.make('SpaceInvaders-v0') File "C:\ProgramData\Anaconda3\lib\site-packages\gym\envs\registration.py", line 156, in make
return registry.make(id, **kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\gym\envs\registration.py", line 101, in make
env = spec.make(**kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\gym\envs\registration.py", line 72, in make
cls = load(self._entry_point) File "C:\ProgramData\Anaconda3\lib\site-packages\gym\envs\registration.py", line 17, in load
mod = importlib.import_module(mod_name) File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed File "C:\ProgramData\Anaconda3\lib\site-packages\gym\envs\atari\__init__.py", line 1, in <module>
from gym.envs.atari.atari_env import AtariEnv File "C:\ProgramData\Anaconda3\lib\site-packages\gym\envs\atari\atari_env.py", line 9, in <module>
import atari_py File "C:\ProgramData\Anaconda3\lib\site-packages\atari_py\__init__.py", line 1, in <module>
from .ale_python_interface import * File "C:\ProgramData\Anaconda3\lib\site-packages\atari_py\ale_python_interface.py", line 18, in <module>
'ale_interface/build/ale_c.dll')) File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 434, in LoadLibrary
return self._dlltype(name) File "C:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in
__init__
self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found [Finished in 0.8s with exit code 1] [shell_cmd: python -u "C:\Users\91920\ML\ReinforcementLearning\space_invaders.py"] [dir: C:\Users\91920\ML\ReinforcementLearning] [path: C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\91920\AppData\Local\Microsoft\WindowsApps;]
我需要做什么?