Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

openai

I'm trying to work with the openai gym module but I get this error:

>>> 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.

I don't have an ale_c.dll and tried finding solutions but nothing worked. I followed the solution here https://github.com/openai/gym/issues/1726 but when trying to import atari_py it comes up with the same error. I don't see why the __init__ would search for something that didn't come with the module either. There were other StackOverflow questions that I looked at but they also yielded no results. The only solution I can think of is to get a copy of ale_c.dll but I don't know how I would get it.

like image 290
ssit Avatar asked Jul 24 '20 19:07

ssit


2 Answers

I was facing the same error. Fortunately, I was able to find one workaround. Follow this steps and you should be good to go.

  1. Download ale_c.dll from here.
  2. Copy it in C:\Users\Deep Raval\AppData\Local\Programs\Python\Python38\Lib\site-packages\atari_py\ale_interface (Your path can be different).
like image 166
Deep Raval Avatar answered Nov 15 '22 16:11

Deep Raval


Try to download arari-py package from conda

conda install -c conda-forge atari_py

this will fix your problem even if you are using Python > 3.7

like image 43
Taylan Kabbani Avatar answered Nov 15 '22 15:11

Taylan Kabbani