gpt4 book ai didi

python - 如何设置 Pyglet 以在 Colab 中与 Manim 一起工作?

转载 作者:行者123 更新时间:2023-12-04 04:15:01 25 4
gpt4 key购买 nike

我正在尝试运行 shaders version of Manim在科拉布。这个版本必须在实时交互窗口中显示渲染视频,而不是仅仅编写 mp4。我安装并导入了所有内容,没有错误:

from manimlib.imports import *

但是运行时出现异常:

!python3 -m manim example_scenes.py OpeningManimExample

Media will be written to ./media/. You can change this behavior with the --media_dir flag.
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/manim/manim.py", line 5, in <module>
manimlib.main()
File "/content/manim/manimlib/__init__.py", line 11, in main
scenes = manimlib.extract_scene.main(config)
File "/content/manim/manimlib/extract_scene.py", line 104, in main
scenes = get_scenes_to_render(all_scene_classes, config)
File "/content/manim/manimlib/extract_scene.py", line 72, in get_scenes_to_render
scene = scene_class(**scene_kwargs)
File "/content/manim/manimlib/scene/scene.py", line 44, in __init__
self.window = Window(self, **self.window_config)
File "/content/manim/manimlib/window.py", line 21, in __init__
super().__init__(**kwargs)
File "/usr/local/lib/python3.6/dist-packages/moderngl_window/context/pyglet/window.py", line 54, in __init__
config=config,
File "/usr/local/lib/python3.6/dist-packages/pyglet/window/xlib/__init__.py", line 165, in __init__
super(XlibWindow, self).__init__(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/pyglet/window/__init__.py", line 588, in __init__
config = screen.get_best_config(config)
File "/usr/local/lib/python3.6/dist-packages/pyglet/canvas/base.py", line 194, in get_best_config
raise window.NoSuchConfigException()
pyglet.window.NoSuchConfigException

最佳答案

Colab 在云端运行。

它不能使用pyglet在您的计算机上打开一个新窗口进行现场实时显示。

所以,着色器版本是不可能的。能成功运行mp4版吗?

关于python - 如何设置 Pyglet 以在 Colab 中与 Manim 一起工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60886590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com