Sim-on-Wheels / Sim-on-wheels-Renderer

10 stars 1 forks source link

pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None" #2

Closed rockywind closed 1 year ago

rockywind commented 1 year ago

Hi, thank you for sharing the great work. I met the error below when I run the script python kitti360.py

Hello from the pygame community. https://www.pygame.org/contribute.html
2023-07-24 03:54:21,662 - moderngl_window - INFO - Attempting to load window class: moderngl_window.context.pyglet.Window
Traceback (most recent call last):
  File "/rockywin.wang/NeRF/Sim-on-wheels-Renderer/kitti360_my.py", line 325, in <module>
    custom_run_window_config(config_cls, values)
  File "/rockywin.wang/NeRF/Sim-on-wheels-Renderer/kitti360_my.py", line 297, in custom_run_window_config
    window, config_obj, timer = setup_window_config(config_cls, values, using_ros, custom_config)
  File "/rockywin.wang/NeRF/Sim-on-wheels-Renderer/kitti360_my.py", line 231, in setup_window_config
    window_cls = mglw.get_local_window_cls(values.window)
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/moderngl_window/__init__.py", line 130, in get_local_window_cls
    return get_window_cls("moderngl_window.context.{}.Window".format(window))
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/moderngl_window/__init__.py", line 112, in get_window_cls
    return import_string(window)
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/moderngl_window/utils/module_loading.py", line 20, in import_string
    module = import_module(module_path)
  File "/opt/conda/envs/suds/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/moderngl_window/context/pyglet/__init__.py", line 1, in <module>
    from .keys import Keys  # noqa
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/moderngl_window/context/pyglet/keys.py", line 12, in <module>
    from pyglet.window import key
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/window/__init__.py", line 1889, in <module>
    gl._create_shadow_window()
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/gl/__init__.py", line 165, in _create_shadow_window
    _shadow_window = ShadowWindow()
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/gl/__init__.py", line 159, in __init__
    super().__init__(width=1, height=1, visible=False)
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/window/xlib/__init__.py", line 133, in __init__
    super(XlibWindow, self).__init__(*args, **kwargs)
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/window/__init__.py", line 513, in __init__
    display = pyglet.canvas.get_display()
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/canvas/__init__.py", line 59, in get_display
    return Display()
  File "/opt/conda/envs/suds/lib/python3.9/site-packages/pyglet/canvas/xlib.py", line 88, in __init__
    raise NoSuchDisplayException(f'Cannot connect to "{name}"')
pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
yshen47 commented 1 year ago

It might be related to your os, just to check, are you using some cloud instance?

rockywind commented 1 year ago

Yes I run the code on the server which there is no any monitor.

rockywind commented 1 year ago

Hi, there is any method to solve this problem?

rockywind commented 1 year ago

I solve it. This is my script.