Julia
Julia

Reputation: 41

OpenAI gym: Trouble installing Atari dependency (Mac OS X)

I'm new to OpenAI gym. I've successfully installed OpenAI gym on my Mac OS X (High Sierra 10.13.3) laptop and made a DQN for the CartPole game. I'm trying to install the Atari dependency to use MsPacman. I tried:

$ pip install gym[atari]

And get that Atari is successfully installed (I see atari_py in the same directory as gym and atari within the gym directory). But when I run the code I get:

raise error.DependencyNotInstalled("{}. (HINT: you can install Atari dependencies by running 'pip install gym[atari]'.)".format(e))
gym.error.DependencyNotInstalled: No module named atari_py. (HINT: you can install Atari dependencies by running 'pip install gym[atari]'.)

If I add:

import atari_py

to the source file, I get:

  File "dqn.py", line 9, in <module>
    import atari_py
ImportError: No module named atari_py

Edit: as per the documentation, I also tried

pip install -e '.[atari]'

And I get:

Directory '.' is not installable. File 'setup.py' not found.

Any thoughts?

Upvotes: 2

Views: 3392

Answers (3)

On Mac OSX Catalina pip3 install 'gym[atari]' worked for me

Upvotes: 1

I had the same problem, this worked for me:

pip install 'gym[atari]'

Upvotes: 9

wpercy
wpercy

Reputation: 10090

From the OpenAI Gym docs you can try

pip install -e '.[atari]'

Upvotes: 0

Related Questions