Skip to content

How to make environment #626

Closed
Closed
@lilyxoxo

Description

@lilyxoxo

Hello, I am a beginner of open ai gym.
I want to add my environment, but I cannot do well.
Could someone tell me how to make new environment?
https://github.com/openai/gym/wiki/Environments
I did it along this wiki, and I run random_agent.py(replace CartPole-v0 to MyEnv-v0)

(ml_env_2)S-no-MacBook-Air-2:agents $ python random_agent.py
[2017-06-18 17:27:44,978] Making new env: MyEnv-v0
Traceback (most recent call last):
File "random_agent.py", line 36, in
env = gym.make(args.env_id)
File "/Users/S/.pyenv/versions/miniconda3-latest/envs/ml_env_2/lib/python2.7/site-packages/gym/envs/registration.py", line 161, in make
return registry.make(id)
File "/Users/S/.pyenv/versions/miniconda3-latest/envs/ml_env_2/lib/python2.7/site-packages/gym/envs/registration.py", line 118, in make
spec = self.spec(id)
File "/Users/S/.pyenv/versions/miniconda3-latest/envs/ml_env_2/lib/python2.7/site-packages/gym/envs/registration.py", line 147, in spec
raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
gym.error.UnregisteredEnv: No registered env with id: MyEnv-v0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions