簡體   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