-2

I am trying to train a model to solve the FrozenLake-v0 problem.

In the process am trying to instantiate the environment in the following way. But encountering an error. Please help me with this

!apt install xvfb -y
!pip install pyvirtualdisplay
!pip install piglet

from pyvirtualdisplay import Display
pip install gym
import torch
import time
import matplotlib.pyplot as plt
pip install pyglet
env = gym.make('FrozenLake-v0')

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-13-3d8d6ba4b349> in <module>()
----> 1 env = gym.make('FrozenLake-v0')

NameError: name 'gym' is not defined
  • 1
    Your question body indicates a different error from your question title - which is it? [ask] – esqew Nov 09 '21 at 01:19
  • 2
    Indeed, you are not defining the name `gym` anywhere in the code, either as a variable or as an imported module. What did you expect `gym` to be? – John Gordon Nov 09 '21 at 01:23

1 Answers1

0

You have not add import gym in the beginning...

Jim Huang
  • 16
  • 3