Gym atari installation

I want to run the pytorch-a3c example with env = PongDeterministic-v4. I’ve had gym, gym[atari], atari-py installed by pip3. And the following codes:

[who@localhost pytorch-a3c]$ python3
Python 3.7.7 (default, Mar 13 2020, 21:39:43) 
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gym import envs
>>> env_names = [ for spec in envs.registry.all()]
>>> for name in sorted(env_names):
...     print(name)

has had the env listed:


I have run the project as its Usage recommended as:

python3 --env-name "PongDeterministic-v4" --num-processes 16

and encountered following exception:

Process Process-1:
Traceback (most recent call last):
  File "/usr/lib64/python3.7/multiprocessing/", line 297, in _bootstrap
  File "/usr/lib64/python3.7/multiprocessing/", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/zf/workspaces/workspace_python/pytorch-a3c/", line 21, in test
    state = env.reset()
  File "/home/zf/.local/lib/python3.7/site-packages/gym/", line 257, in reset
    observation = self.env.reset(**kwargs)
  File "/home/zf/.local/lib/python3.7/site-packages/gym/", line 258, in reset
    return self.observation(observation)
  File "/home/zf/.local/lib/python3.7/site-packages/gym/", line 265, in observation
    raise NotImplementedError

And the command for env = Tennis-ram-v0 also failed with the same exception.

I am not experienced in python environment. Would you please hint the possible solutions?

This error seems to be gym related and while I’m not experienced with this library, I guess the method tries to display something?
If that’s the case, could you check if some visualization/rendering libs and other dependencies are installed, such as pyglet?

Seems like a gym version/custom wrapper problem defined in the library.

It’s calling the abstract class method that will raise this error here, so the error is expected.

The question is why is the method called? Can you show the code where the environment gets initialized, and where it calls reset(), i.e. snippet from your

U can also try this example of creating and calling the gym env methods that works:

import gym

env = gym.make('PongDeterministic-v4')

Seemed the issue has been solved by pytorch-a3c issue#66. The project still failed to work while the problem is beyond this question.

Sorry for not have been searching for solution efficiently and thank you very much for you help