本文介绍了如何设置Pyglet与Colab中的Manim一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Colab中运行 Manim的着色器版本.此版本必须在实时互动窗口中显示渲染的视频,而不是仅编写mp4.我安装并导入了所有内容,没有错误:

I'm trying to run shaders version of Manim in Colab. This version has to show rendered video in a live interactive window, as opposed to just writing mp4. I installed and imported everything without errors:

from manimlib.imports import *

但是在运行时会出现异常:

but get an exception when run:

!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在云上运行.

Colab is run on the cloud.

它不能使用pyglet在计算机上打开新窗口进行实时实时显示.

It cannot use pyglet to open a new window on your computer for live realtime display.

因此,着色器版本是不可能的.您可以成功运行mp4版本吗?

So, shader version is impossible. Can you run mp4 version successfully?

这篇关于如何设置Pyglet与Colab中的Manim一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 11:39