Chapter 2.1 gym.error.UnregisteredEnv: No registered env with id: CartPoleStayUp-v0

I tried to copy the cartpole project into an own rosject and after installing the open_ros package
I get this error. I had this error allready in other rosjects too. Please help me :slight_smile:


user:~$ roslaunch my_cartpole_training2 start_training.launch
… logging to /home/user/.ros/log/3798d6ca-69c0-11ea-8c6f-02dbf1782f02/roslaunch-rosdscomputer-7689.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://rosdscomputer:38397/



  • /cartpole_v0/alpha: 0.5
  • /cartpole_v0/control_type: velocity
  • /cartpole_v0/epsilon: 0.1
  • /cartpole_v0/epsilon_discount: 0.999
  • /cartpole_v0/gamma: 0.9
  • /cartpole_v0/init_pos: 0.0
  • /cartpole_v0/max_base_pose_x: 2.5
  • /cartpole_v0/max_base_velocity: 50
  • /cartpole_v0/max_pole_angle: 0.7
  • /cartpole_v0/min_base_pose_x: -2.5
  • /cartpole_v0/min_pole_angle: -0.7
  • /cartpole_v0/n_actions: 4
  • /cartpole_v0/nepisodes: 1000
  • /cartpole_v0/nsteps: 1000
  • /cartpole_v0/number_splits: 10
  • /cartpole_v0/pos_step: 0.016
  • /cartpole_v0/running_step: 0.04
  • /cartpole_v0/wait_time: 0.1
  • /rosdistro: kinetic
  • /rosversion: 1.12.14

cartpole_gym (my_cartpole_training2/

auto-starting new master
process[master]: started with pid [7719]

setting /run_id to 3798d6ca-69c0-11ea-8c6f-02dbf1782f02
process[rosout-1]: started with pid [7745]
started core service [/rosout]
process[cartpole_gym-2]: started with pid [7760]
/usr/local/lib/python2.7/dist-packages/requests/ RequestsDependencyWarning: urllib3 (1.25.8) or chardet (2.3.0) doesn’t match a supported version!
/usr/local/lib/python2.7/dist-packages/requests/ RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
warnings.warn(warning, RequestsDependencyWarning)
Traceback (most recent call last):
File “/home/user/catkin_ws/src/my_cartpole_training2/src/”, line 24, in
env = gym.make(‘CartPoleStayUp-v0’)
File “/usr/local/lib/python2.7/dist-packages/gym/envs/”, line 161, in make
return registry.make(id)
File “/usr/local/lib/python2.7/dist-packages/gym/envs/”, line 118, in make
spec = self.spec(id)
File “/usr/local/lib/python2.7/dist-packages/gym/envs/”, line 147, in spec
raise error.UnregisteredEnv(‘No registered env with id: {}’.format(id))
gym.error.UnregisteredEnv: No registered env with id: CartPoleStayUp-v0
[cartpole_gym-2] process has died [pid 7760, exit code 1, cmd /home/user/catkin_ws/src/my_cartpole_training2/src/ __name:=cartpole_gym __log:=/home/user/.ros/log/3798d6ca-69c0-11ea-8c6f-02dbf1782f02/cartpole_gym-2.log].
log file: /home/user/.ros/log/3798d6ca-69c0-11ea-8c6f-02dbf1782f02/cartpole_gym-2*.log

Thank you very much for your time :slight_smile:

Hi @gayda.julian,
You have to register the gym environment first. Run your environment script first. At the top there should be something similar to this:

                entry_point='task_env_tf:j2n6s300TestEnv' )

Once you have done that, you can make this environemnt.

1 Like