Gym atari installation

Hi,
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 = [spec.id for spec in envs.registry.all()]
>>> for name in sorted(env_names):
...     print(name)
... 

has had the env listed:

Pong-ram-v0
Pong-ram-v4
Pong-ramDeterministic-v0
Pong-ramDeterministic-v4
Pong-ramNoFrameskip-v0
Pong-ramNoFrameskip-v4
Pong-v0
Pong-v4
PongDeterministic-v0
PongDeterministic-v4
PongNoFrameskip-v0
PongNoFrameskip-v4

I have run the project as its Usage recommended as:

python3 main.py --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/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/lib64/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/zf/workspaces/workspace_python/pytorch-a3c/test.py", line 21, in test
    state = env.reset()
  File "/home/zf/.local/lib/python3.7/site-packages/gym/core.py", line 257, in reset
    observation = self.env.reset(**kwargs)
  File "/home/zf/.local/lib/python3.7/site-packages/gym/core.py", line 258, in reset
    return self.observation(observation)
  File "/home/zf/.local/lib/python3.7/site-packages/gym/core.py", line 265, in observation
    raise NotImplementedError
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 test.py.

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

import gym

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

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