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

[Question] 'NoneType' object has no attribute 'glfwGetCurrentContext' #1224

Open
qffof opened this issue Oct 21, 2024 · 3 comments
Open

[Question] 'NoneType' object has no attribute 'glfwGetCurrentContext' #1224

qffof opened this issue Oct 21, 2024 · 3 comments
Labels
question Further information is requested

Comments

@qffof
Copy link

qffof commented Oct 21, 2024

Question

Hi!I have some questions for you
background:

gymnasium: 1.0.0
glfw: 2.7.0

I run the code below:

import gymnasium as gym
env=gym.make('Humanoid-v5', render_mode='human')
obs=env.reset()
env.render()

An error was reported :

  logger.deprecation(
  File "D:\anaconda\envs\Gemma2b\lib\site-packages\gymnasium\envs\mujoco\mujoco_rendering.py", line 359, in __del__
  File "D:\anaconda\envs\Gemma2b\lib\site-packages\gymnasium\envs\mujoco\mujoco_rendering.py", line 352, in free
  File "D:\anaconda\envs\Gemma2b\lib\site-packages\glfw\__init__.py", line 2366, in get_current_context
AttributeError: 'NoneType' object has no attribute 'glfwGetCurrentContext'

When I take the solution given earlier:

import gymnasium as gym
env=gym.make('Humanoid-v5', render_mode='human')
obs=env.reset()
env.render()
breakpoint()

The result of the code run is: The mojoco simulation interface is not responding

@qffof qffof added the question Further information is requested label Oct 21, 2024
@Beanpow
Copy link
Contributor

Beanpow commented Oct 22, 2024

You may have to close the env before the program ends.

import gymnasium as gym
env=gym.make('Humanoid-v5', render_mode='human')
obs=env.reset()
env.render()
env.close()

@pseudo-rnd-thoughts
Copy link
Member

This might be a windows only issue

We don't officially support windows but will try to fix bugs

@Kallinteris-Andreas
Copy link
Collaborator

If you're using Windows, try the Linux subsystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants