在Windows 10上使用OpenAI Gym-Atari时出现“ OSError:[WinError 126]找不到指定的模块”

时间:2019-05-30 18:01:24

标签: python reinforcement-learning openai-gym

我只是想执行以下简单的试用代码:

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;]

我需要做什么?

1 个答案:

答案 0 :(得分:0)

我将为您介绍ale_python_interface存储库中的一个问题。

https://github.com/bbitmaster/ale_python_interface/issues/10

Windows似乎不支持此问题,并且此问题已于2018年10月1日打开。