3b1b / 3b1b/manim

Error on WSL 2

未關閉
#1,812 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
93.9k
分支
7.7k
平均合併
2 天 13 小時
30 天內合併 PR
4

描述

### Describe the error

its my first time with manim. I use WSL and after setting it up and running with this command
manimgl start.py SquareToCirlce
directory fo start.py is manimlib
i suspect its Xserver issue, I am using GWSL
gives below error
### Code and Error
**Code**:
from manimlib import *

class SquareToCircle(Scene):
def construct(self):
circle = Circle()
circle.set_fill(BLUE, opacity=0.5)
circle.set_stroke(BLUE_E, width=4)

self.add(circle)

**Error**:

Traceback (most recent call last):
File "/home/shery/.local/bin/manimgl", line 5, in
from manimlib.__main__ import main
File "/home/shery/.local/lib/python3.8/site-packages/manimlib/__init__.py", line 23, in
from manimlib.window import *
File "/home/shery/.local/lib/python3.8/site-packages/manimlib/window.py", line 5, in
from moderngl_window.context.pyglet.window import Window as PygletWindow
File "/home/shery/.local/lib/python3.8/site-packages/moderngl_window/context/pyglet/__init__.py", line 1, in
from .keys import Keys # noqa
File "/home/shery/.local/lib/python3.8/site-packages/moderngl_window/context/pyglet/keys.py", line 12, in
from pyglet.window import key
File "/home/shery/.local/lib/python3.8/site-packages/pyglet/window/__init__.py", line 1918, in
gl._create_shadow_window()
File "/home/shery/.local/lib/python3.8/site-packages/pyglet/gl/__init__.py", line 206, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/home/shery/.local/lib/python3.8/site-packages/pyglet/window/xlib/__init__.py", line 171, in __init__
super(XlibWindow, self).__init__(*args, **kwargs)
File "/home/shery/.local/lib/python3.8/site-packages/pyglet/window/__init__.py", line 590, in __init__
display = pyglet.canvas.get_display()
File "/home/shery/.local/lib/python3.8/site-packages/pyglet/canvas/__init__.py", line 94, in get_display
return Display()
File "/home/shery/.local/lib/python3.8/site-packages/pyglet/canvas/xlib.py", line 123, in __init__
raise NoSuchDisplayException('Cannot connect to "%s"' % name)
pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to "None"
### Environment
**OS System**: Windows Subsystem For linux version 2
**manim version**: master
**python version**: 2.7.18

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

此錯誤是 WSL 2 上的 pyglet 顯示例外,可能是由於缺少 X11 forwarding。檢查 manimlib/window.py 中 manim 的視窗初始化和 moderngl_window/pyglet 的整合。首先確認 X 伺服器(GWSL)正在運行且已設定 DISPLAY。查找文檔或現有 issue 中關於顯示配置的 WSL 特定設定。'Done' 表示範例在沒有 NoSuchDisplayException 的情況下運行。

由索引模型根據 Issue 內容生成。

評估

領域
desktop, developer-experience
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。