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

Cannot run the example #72

Open
xyang2013 opened this issue Jul 10, 2024 · 0 comments
Open

Cannot run the example #72

xyang2013 opened this issue Jul 10, 2024 · 0 comments

Comments

@xyang2013
Copy link

xyang2013 commented Jul 10, 2024

Context:

  1. Install gym-sokoban from the source:
    python install -e .

  2. Running the following code in a Jupyter notebook:

import gym 
import gym_sokoban

env = gym.make('Sokoban-v0')
#env.reset()

env.render(mode='human')

action = env.action_space.sample()
observation, reward, done, info = env.step(action)
  1. Error:
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
Cell In[9], line 1
----> 1 env = gym.make('Sokoban-v0')
      2 #env.reset()
      4 env.render(mode='human')

File ~/miniconda3/envs/llama3/lib/python3.9/site-packages/gym/envs/registration.py:640, in make(id, max_episode_steps, autoreset, apply_api_compatibility, disable_env_checker, **kwargs)
    637     render_mode = None
    639 try:
--> 640     env = env_creator(**_kwargs)
    641 except TypeError as e:
    642     if (
    643         str(e).find("got an unexpected keyword argument 'render_mode'") >= 0
    644         and apply_human_rendering
    645     ):

File ~/miniconda3/envs/llama3/lib/python3.9/site-packages/gym_sokoban/envs/sokoban_env_variations.py:14, in __init__(self)

File ~/miniconda3/envs/llama3/lib/python3.9/site-packages/gym_sokoban/envs/sokoban_env.py:48, in SokobanEnv.__init__(self, dim_room, max_steps, num_boxes, num_gen_steps, reset)
     44 self.observation_space = Box(low=0, high=255, shape=(screen_height, screen_width, 3), dtype=np.uint8)
     46 if reset:
     47     # Initialize Room
---> 48     _ = self.reset()
...
    408 else:
    409     # Writing: check that the directory to write to does exist
    410     dn = os.path.dirname(fn)

FileNotFoundError: No such file: '/home/xy/miniconda3/envs/llama3/lib/python3.9/site-packages/gym_sokoban/envs/surface/box.png'
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
  1. After checking the site-package folder, I found there is no gym_sokoban folder. There is only an egg-link file:
gym-sokoban.egg-link

I am not sure how I can fix the above issue and get it running.

@xyang2013 xyang2013 changed the title Cannot run example Cannot run the example Jul 10, 2024
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

1 participant