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

Issues with Rendering - no attribute 'glfwGetCurrentContext' #490

Closed
varungupta31 opened this issue Aug 5, 2024 · 2 comments
Closed

Issues with Rendering - no attribute 'glfwGetCurrentContext' #490

varungupta31 opened this issue Aug 5, 2024 · 2 comments

Comments

@varungupta31
Copy link

I am new to this benchmark and tool.

I installed as per the documentation

pip install git+https://github.com/Farama-Foundation/Metaworld.git@master#egg=metaworld

And tried the started code,

import metaworld
import random

print(metaworld.ML1.ENV_NAMES)  # Check out the available environments

env_name = 'basketball-v2' # Pick an environment name

render_mode = 'human' # set a render mode

ml1 = metaworld.ML1(env_name) # Construct the benchmark, sampling tasks

env = ml1.train_classes[env_name](render_mode=render_mode)
task = random.choice(ml1.train_tasks)
env.set_task(task)  # Set task

obs = env.reset()  # Reset environment
a = env.action_space.sample()  # Sample an action
obs, reward, terminate, truncate, info = env.step(a)

I run into this error,

Exception ignored in: <function WindowViewer.__del_ at 0x10724c310>
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/meta/lib/python3.10/site-pack ages/gymnasium/envs/mujoco/mujoco_rendering.py", line 359, in _del_
File "/opt/homebrew/Caskroom/miniconda/base/envs/meta/lib/python3.10/site-pack
ages/gymnasium/envs/mujoco/mujoco_rendering.py", line 352, in free
File "/opt/homebrew/Caskroom/miniconda/base/envs/meta/lib/python3.10/site-pack
ages/glfw/_
-
init
_py", line 2366, in get_current_context
AttributeError: 'NoneType' object has no attribute 'glfwGetCurrentContext'

A similar error was observed on Ubuntu 20.04, with the same setup instruction and code.

Kindly help,
Thanks.

@varungupta31 varungupta31 changed the title Issues with Rendering - no attribute 'glfwGetCurrentContext' [MacOS] Issues with Rendering - no attribute 'glfwGetCurrentContext' Aug 5, 2024
@reginald-mclean
Copy link
Collaborator

That's not an error that causes problems, it happens when your script ends without explicitly calling env.close()

@varungupta31
Copy link
Author

Thanks, figured that out ... rookie mistake 🫠

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

2 participants