繁体   English   中英

找不到模块 \atari_py\ale_interface\ale_c.dll (或其依赖项之一)

[英]Could not find module \atari_py\ale_interface\ale_c.dll (or one of its dependencies)

我正在尝试使用 openai gym 模块,但出现此错误:

>>> import atari_py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ssit5\AppData\Local\Programs\Python\Python38\lib\site-packages\atari_py\__init__.py", line 1, in <module>
    from .ale_python_interface import *
  File "C:\Users\ssit5\AppData\Local\Programs\Python\Python38\lib\site-packages\atari_py\ale_python_interface.py", line 17, in <module>
    ale_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__),
  File "C:\Users\ssit5\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\ssit5\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\ssit5\AppData\Local\Programs\Python\Python38\lib\site-packages\atari_py\ale_interface\ale_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.

我没有 ale_c.dll 并尝试寻找解决方案但没有任何效果。 我在这里遵循了解决方案https://github.com/openai/gym/issues/1726但是在尝试导入 atari_py 时出现了同样的错误。 我不明白为什么__init__会搜索模块没有附带的东西。 我查看了其他 StackOverflow 问题,但也没有产生任何结果。 我能想到的唯一解决方案是获取 ale_c.dll 的副本,但我不知道如何获得它。

我面临同样的错误。 幸运的是,我找到了一种解决方法。 按照这个步骤,你应该对 go 很好。

  1. 这里下载ale_c.dll
  2. 将其复制到C:\Users\Deep Raval\AppData\Local\Programs\Python\Python38\Lib\site-packages\atari_py\ale_interface (您的路径可以不同)。

I have tried to make it work with python 3.8 and 3.9 on Windows 10. Installing Python 3.7 and using it as the Python Interpreter on PyCharm resolved the issue. 我在拥有 3.8 + 版本的 Python 时搜索了丢失的文件,但它根本不存在。 仅 Python 3.7 ( https://github.com/openai/atari-py ) 支持 Atari-py,因此无法使用更高版本。 从未经许可的地方下载文件是个坏主意,因此我建议您安装受支持的 Python 版本(3.5、3.6 和 3.7)。 即使gym可以在3.9上运行,但atari版本却不行。

尝试从 conda 下载 arari-py package

conda install -c conda-forge atari_py

即使您使用的是 Python > 3.7,这也将解决您的问题

对于未来的其他人,我的问题是我遇到了同样的错误,但我已经在正确的文件夹中拥有了 ale_c.dll 文件。

我在此链接上遵循了解决方案-> https://github.com/openai/gym/issues/1726

我建议从这里为您下载车轮文件 Windows 和 Python 版本: https://pypi.org/simple/atari-py/

然后在此文件上执行pip install ,如:

pip install atari_py-0.2.9-cp39-cp39-win_amd64.whl

这对我有帮助(来自 github 的解决方案似乎好多了,但它对我不起作用 - 可能是因为 venv?) - 对我来说,这是一个比从谷歌驱动器下载 a.dll 更安全的解决方案。

这是您在使用 Windows 时可能会遇到的问题。

使用以下命令卸载并重新安装 atari:

pip install -f https://github.com/Kojoley/atari-py/releases atari_py 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM