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

Update passive_env_checker.py to fix "bool8 error" #3310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JilinJL
Copy link

@JilinJL JilinJL commented Mar 11, 2025

fix the bool8 error
bool8 -> bool

I have tested the change and made sure it runs well

Description

Running the demo code in DemoCode export an error

Code example

import gym
env = gym.make("LunarLander-v2", render_mode="human")
env.action_space.seed(42)

observation, info = env.reset(seed=42)

for _ in range(1000):
    observation, reward, terminated, truncated, info = env.step(env.action_space.sample())

    if terminated or truncated:
        observation, info = env.reset()

env.close()

System Info

File "E:\learn.venv\Lib\site-packages\gym\utils\passive_env_checker.py", line 233, in env_step_passive_checker
if not isinstance(terminated, (bool, np.bool8)):
^^^^^^^^
File "E:\learn.venv\Lib\site-packages\numpy_init_.py", line 427, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?
libpng warning: iCCP: cHRM chunk does not match sRGB

Additional context
I edited the source code to ensure that the code can be run.Maybe there is a version problem here.

Checklist

  • I have checked that there is no similar issue in the repo (required)
    In fact, there is a similar PR, but it seems to have expired

Fixes #3258 #3294

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Please attach before and after screenshots of the change if applicable.

Before ❌ After ✔
image image

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • [x ] New and existing unit tests pass locally with my changes

fix the bool8 error
bool8 -> bool

**I have tested the change and made sure it runs well**
@JilinJL
Copy link
Author

JilinJL commented Mar 11, 2025

As of 3.11.2025, the code works!

@pseudo-rnd-thoughts
Copy link
Contributor

Hey, the dev team launched gymnasium, a fork of Gym by the maintainers where all maintenance and improvements will happen moving forward. Therefore, we are not updating or maintaining this repo anymore

@JilinJL
Copy link
Author

JilinJL commented Mar 11, 2025

Oh, My God. My first PR, BAD ENDING. sorry!

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

Successfully merging this pull request may close these issues.

2 participants