Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hey, i install the env but got a exception #7

Closed
kdldbq opened this issue Jul 8, 2017 · 7 comments
Closed

hey, i install the env but got a exception #7

kdldbq opened this issue Jul 8, 2017 · 7 comments

Comments

@kdldbq
Copy link

kdldbq commented Jul 8, 2017

raise error.UnregisteredEnv('No registered env with id: {}'.format(id))

gym.error.UnregisteredEnv: No registered env with id: ppaquette/SuperMarioBros-1-1-v0

@Zoltar-The-Goat
Copy link

@17760875908 what does your code look like? Specifically the env = gym.make()

@kdldbq
Copy link
Author

kdldbq commented Jul 14, 2017

import gym

import gym_pull
gym_pull.pull('github.com/ppaquette/gym-super-mario')
env = gym.make('ppaquette/SuperMarioBros-1-1-v0')
for i_episode in range(100):
    observation = env.reset()
    while True:
        env.render()  
        action = env.action_space.sample()
        observation, reward, done, info = env.step(action)  
        print(observation, reward, done, info)
        if done:
            break
MadeByGod:etc zw.Zhao$ sudo python3 /Users/zzw/PycharmProjects/TensorFlow/MARIO.py
Password:
The directory '/Users/zzw/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
[2017-07-14 11:34:06,019] Installing pip package from "https://github.com/ppaquette/gym-super-mario.git"
The directory '/Users/zzw/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/zzw/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/zzw/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting git+https://github.com/ppaquette/gym-super-mario.git
  Cloning https://github.com/ppaquette/gym-super-mario.git to /private/tmp/pip-0qwv_30h-build
Requirement already up-to-date: gym>=0.8.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: six in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: pyglet>=1.2.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: requests>=2.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: numpy>=1.10.4 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests>=2.0->gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: urllib3<1.22,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests>=2.0->gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: idna<2.6,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests>=2.0->gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Requirement already up-to-date: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests>=2.0->gym>=0.8.0->ppaquette-gym-super-mario==0.0.7)
Installing collected packages: ppaquette-gym-super-mario
  Found existing installation: ppaquette-gym-super-mario 0.0.7
    Uninstalling ppaquette-gym-super-mario-0.0.7:
      Successfully uninstalled ppaquette-gym-super-mario-0.0.7
  Running setup.py install for ppaquette-gym-super-mario ... done
Successfully installed ppaquette-gym-super-mario-0.0.7
The directory '/Users/zzw/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
[2017-07-14 11:34:16,101] The user environments for "github.com/ppaquette/gym-super-mario" are already up-to-date (no new version detected).
[2017-07-14 11:34:16,101] Making new env: ppaquette/SuperMarioBros-1-1-v0
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 137, in spec
    return self.env_specs[id]
KeyError: 'ppaquette/SuperMarioBros-1-1-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/zzw/PycharmProjects/TensorFlow/MARIO.py", line 5, in <module>
    env = gym.make('ppaquette/SuperMarioBros-1-1-v0')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 161, in make
    return registry.make(id)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gym/envs/registration.py", line 118, in make
    spec = self.spec(id)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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: ppaquette/SuperMarioBros-1-1-v0

this is my code and log @Zoltar-The-Goat

@kolt-mcb
Copy link

you will need to manually add the env to your init file.

add

register(
	id='meta-SuperMarioBros-Tiles-v0',
	entry_point='gym.envs.gym_super_mario:MetaSuperMarioBrosEnv',
	kwargs={ 'draw_tiles': 1},
	reward_threshold=(3266 - 40),
	nondeterministic=True,
	
)		

to ~/.local/lib/python3.5/site-packages/gym/envs/init.py

I have much experience with this env so please ask if you have any questions.

@zhanwenchen
Copy link

@koltafrickenfer your comment did not solve the issue for me.

If anyone is running into this issue, see this related thread for solutions.

@kolt-mcb
Copy link

kolt-mcb commented Oct 1, 2017

you have to register each environment desperately with a different id and entry point. I am sorry I did not make this more clear.

@MBoaretto25
Copy link

How do you perform the env = gym.make.... step after you register the environment manually?
env = gym.make('ppaquette/SuperMarioBros-1-1-v0') or env = gym.make('meta-SuperMarioBros-Tiles-v0') ??

@atomikcircus3
Copy link

you will need to manually add the env to your init file.

add

register(
	id='meta-SuperMarioBros-Tiles-v0',
	entry_point='gym.envs.gym_super_mario:MetaSuperMarioBrosEnv',
	kwargs={ 'draw_tiles': 1},
	reward_threshold=(3266 - 40),
	nondeterministic=True,
	
)		

to ~/.local/lib/python3.5/site-packages/gym/envs/init.py

I have much experience with this env so please ask if you have any questions.

Hello. Can you help me with installing and running up this env?

@kdldbq kdldbq closed this as completed Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants