Gym atari installation

fulltopic: <p>Hi,<br>
I want to run the <a href="https://github.com/ikostrikov/pytorch-a3c" rel="nofollow noopener">pytorch-a3c example</a> with env = PongDeterministic-v4. I’ve had gym, gym[atari], atari-py installed by pip3. And the following codes:</p>
<pre><code class="lang-auto">[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.
&gt;&gt;&gt; from gym import envs
&gt;&gt;&gt; env_names = [spec.id for spec in envs.registry.all()]
&gt;&gt;&gt; for name in sorted(env_names):
...     print(name)
... 

</code></pre>
<p>has had the env listed:</p>
<pre><code class="lang-auto">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

</code></pre>
<p>I have run the project as its Usage recommended as:</p>
<pre><code class="lang-auto">python3 main.py --env-name "PongDeterministic-v4" --num-processes 16
</code></pre>
<p>and encountered following exception:</p>
<pre><code class="lang-auto">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

</code></pre>
<p>And the command for env = Tennis-ram-v0 also failed with the same exception.</p>
<p>I am not experienced in python environment. Would you please hint the possible solutions?</p>

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

kengz: <p>Seems like a gym version/custom wrapper problem defined in the library.</p>
<p>It’s calling the abstract class method that will raise this error <a href="https://github.com/openai/gym/blob/3bd5ef71c2ca3766a26c3dacf87a33a9390ce1e6/gym/core.py#L255" rel="nofollow noopener">here</a>, so the error is expected.</p>
<p>The question is why is the method called? Can you show the code where the environment gets initialized, and where it calls <code>reset()</code>, i.e. snippet from your <code>test.py</code>.</p>
<p>U can also try this example of creating and calling the gym env methods that works:</p>
<pre><code class="lang-python">import gym

env = gym.make('PongDeterministic-v4')
env.reset()
</code></pre>

fulltopic: <p>Seemed the issue has been solved by <a href="https://github.com/ikostrikov/pytorch-a3c/issues/66" rel="nofollow noopener">pytorch-a3c issue#66</a>. The project still failed to work while the problem is beyond this question.</p>
<p>Sorry for not have been searching for solution efficiently and thank you very much for you help</p>