google-deepmind / google-deepmind/dm_control
viewer not working on mac osx
- Dominant language
- Python
- Stars
- 4.7k
- Forks
- 764
- PR merge metrics
- No merged PRs in 30d
Description
Using the latest install for both dm_control and mujoco via pypi, the viewer can not render a window on OSX (intel chip).
Script:
```
from dm_control import suite
from dm_control import viewer
import numpy as np
env = suite.load(domain_name="point_mass", task_name="easy")
action_spec = env.action_spec()
# Define a uniform random policy.
def random_policy(time_step):
del time_step # Unused.
return np.random.uniform(low=action_spec.minimum,
high=action_spec.maximum,
size=action_spec.shape)
# Launch the viewer application.
viewer.launch(env, policy=random_policy)
```
Error output:
```
script_render_dm.py 51
"/Users/user/mjc/script_render_dm.py", line 51
viewer.launch(env, policy=random_policy)
__init__.py 39 launch
"/Users/user/.virtualenvs/p39/lib/python3.9/site-packages/dm_control/viewer/__init__.py", line 39
app = application.Application(title=title, width=width, height=height)
application.py 187 __init__
"/Users/user/.virtualenvs/p39/lib/python3.9/site-packages/dm_control/viewer/application.py", line 187
self._window = gui.RenderWindow(width, height, title)
__init__.py 34 ErrorRenderWindow
"/Users/user/.virtualenvs/p39/lib/python3.9/site-packages/dm_control/viewer/gui/__init__.py", line 34
raise ImportError(
ImportError:
Cannot create a window because no windowing system could be imported
```
Contributor guide
Research direction
Reproduce the failure with script_render_dm.py and the provided dm_control viewer example. Read viewer/__init__.py, viewer/application.py, and viewer/gui/__init__.py around the reported traceback; done means the viewer creates and renders a window on Intel macOS without the ImportError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100