当前位置: 首页 > news >正文

Linux manim安装

简介

根据文档可知, manim目前分为两个版本, 一个是由3Blue1Brown维护更新的最新版本的manimgl, 另一个是稳定的社区版本manim or manimce. 两个版本在安装和使用上都有些不同, 不要搞混.

Linux manim ERROR

No package ‘pangocairo’ found

Getting requirements to build wheel ... errorerror: subprocess-exited-with-error× Getting requirements to build wheel did not run successfully.│ exit code: 1╰─> [31 lines of output]Package pangocairo was not found in the pkg-config search path.Perhaps you should add the directory containing `pangocairo.pc'to the PKG_CONFIG_PATH environment variableNo package 'pangocairo' found

看报错信息, 是pangocairo的问题, 手动下载编译安装
从官网下载pango-1.51.0.
解压后进入文件夹内
在这里插入图片描述
可知是使用mesonninjia构建的.
首先下载

pip3 install meson ninja

构建的一般过程如下:

# 通过--prefix指定install路径, 不然默认装到系统路径(无权限) meson setup $builddir --prefix=${path to install}ninja -C $builddirninja -C $builddir install

可在文件夹下新建一个build作为$builddir, install位置可以就设为pango-1.51.0文件夹.
按步骤安装完毕后, 在.bashrc中写入pangocairo.pc所在的位置
先查找

$ find ./ -name "pangocairo.pc"
./lib/x86_64-linux-gnu/pkgconfig/pangocairo.pc
./build/meson-private/pangocairo.pc

所以在.bashrc中写入

# pkg-config path
export PKG_CONFIG_PATH="/path/to/pango-1.51.2/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH"

source ~/.bashrc再次进行pip install manim即可.

Original error: libpangocairo-1.0.so.0: cannot open shared object file: No such file or directory

类似地, 在.bashrc加入环境变量

# 修改为对应的pango路径
export LD_LIBRARY_PATH="/pango/path/pango-1.51.2/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH"

ImportError: /lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0

根据comment, 设置环境变量

export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libffi.so.7

Unknown encoder ‘libx264’

卸载重装ffmpeg即可

FileNotFoundError: [Errno 2] No such file or directory: ‘xdg-open’

视频已经成功生成, 应该是在服务器终端无法自动打开的意思.
-p参数表示Previewed, 去掉该参数即可. 并且在本应用中使用后端投放到web UI上, 无需预览功能.
下面是无root用户尝试解决/安装xdg-open的记录.


这个comment说更新sededu, 下载之后好像不起作用.
参考这个, 尝试手动安装xdg-utils.
下载xdg-utils-v1.2.1

./configure --prefix=/path/to/install
make && make install -j8

/usr/bin/xmlto: not found/home/stlinpeiyang/lpy22/software/xmlto-0.0.28

安装xmlto

尝试从这里尝试安装xmlto

./configure --prefix=/path/to/install
make && make install -j8

没问题, 填入环境变量再次尝试安装xdg
失败 暂时no way

直接安装deb包

从这里下载xdg-utils_1.1.3
使用

# 应该要使用绝对路径才有效
dpkg -x xdg-utils_1.1.3-2ubuntu1_all.deb /path/to/install

然后就会在路径下生成usr/bin等文件夹和文件

(py_LLM) user@ubuntu:~/lpy22/software$ ls .local/usr/bin/
browse            xdg-desktop-menu  xdg-icon-resource  xdg-open         xdg-settings
xdg-desktop-icon  xdg-email         xdg-mime           xdg-screensaver

然后加入环境变量再激活即可.

export PATH=$PATH:/path/to/.local/usr/bin/

安装cairo

下载文件cairo-1.18.0

 error: unknown type name ‘pixman_dither_t’; did you mean ‘pixman_filter_t’?954 |     pixman_dither_t pixman_dither = _cairo_dither_to_pixman_dither (source->dither);|     ^~~~~~~~~~~~~~~|     pixman_filter_t
../src/cairo-image-surface.c:954:37: error: implicit declaration of function ‘_cairo_dither_to_pixman_dither’ [-Werror=implicit-function-declaration]954 |     pixman_dither_t pixman_dither = _cairo_dither_to_pixman_dither (source->dither);|                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/cairo-image-surface.c:955:5: error: implicit declaration of function ‘pixman_image_set_dither’; did you mean ‘pixman_image_set_filter’? [-Werror=implicit-function-declaration]955 |     pixman_image_set_dither (surface->pixman_image, pixman_dither);|     ^~~~~~~~~~~~~~~~~~~~~~~|     pixman_image_set_filter
cc1: some warnings being treated as errors
[171/722] Compiling C object src/libcairo.so.2.11800.0.p/cairo-pdf-surface.c.o
ninja: build stopped: subcommand failed.

一般系统都自带cairo 遂放弃.


manimgl ERROR

screeninfo.common.ScreenInfoError: No enumerators available

manimgl好像是需要一个窗口来进行交互或预览, 所以在Linux服务器跑不了.
文档
在这里插入图片描述
在服务器尝试manimgl报错如下:

python3.10/site-packages/screeninfo/screeninfo.py", line 32, in get_monitorsraise ScreenInfoError("No enumerators available")
screeninfo.common.ScreenInfoError: No enumerators available

目前还没解决
关于Pyglet Window

FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\PLA\AppData\Local\Temp\Tex\42c962cc458aefe6.log’

在Windows下若不是安装在C盘, 则会显示找不到tex log文件. 解决方法如下:
default_config.yml文件中

# Manim often generates tex_files or other kinds of serialized data# to keep from having to generate the same thing too many times.  By# default, these will be stored at tempfile.gettempdir(), e.g. this might# return whatever is at to the TMPDIR environment variable.  If you want to# specify them elsewhere,temporary_storage: "E:\\projects\\manim\\media"

manim文件夹下新建media文件夹添加为temporary_storage即可.

相关文章:

  • 幻兽帕鲁服务器价格太卷了,4核16G游戏联机服务器价格24元
  • String类相关oj练习
  • amazon中sns的使用
  • Android ViewBinding 使用
  • 【QT入门】 Qt自定义信号后跨线程发送信号
  • 基于大语言模型的云故障根因分析|顶会EuroSys24论文
  • 操作系统系列学习——多级页表与快表
  • k8s入门到实战(十四)—— Helm详细介绍及使用
  • Java实现猜数字游戏:编程入门之旅
  • 数学建模常用的代码
  • Jmeter 从登录接口提取cookie 并 跨线程组调用cookie (超详细)
  • 游戏本笔记本更换@添加内存条实操示例@DDR5内存条
  • Linux 基于HAProxy+KeepAlived实现
  • 安防监控视频汇聚平台EasyCVR启用图形验证码之后如何调用login接口?
  • linux入门级学习指南
  • 30天自制操作系统-2
  • Cookie 在前端中的实践
  • javascript从右向左截取指定位数字符的3种方法
  • Javascript设计模式学习之Observer(观察者)模式
  • JS函数式编程 数组部分风格 ES6版
  • Laravel核心解读--Facades
  • react-core-image-upload 一款轻量级图片上传裁剪插件
  • Spark RDD学习: aggregate函数
  • ubuntu 下nginx安装 并支持https协议
  • 阿里中间件开源组件:Sentinel 0.2.0正式发布
  • 第2章 网络文档
  • 诡异!React stopPropagation失灵
  • 检测对象或数组
  • 少走弯路,给Java 1~5 年程序员的建议
  • 设计模式走一遍---观察者模式
  • 使用common-codec进行md5加密
  • 使用Gradle第一次构建Java程序
  • 数据科学 第 3 章 11 字符串处理
  • 网络应用优化——时延与带宽
  • 微信小程序上拉加载:onReachBottom详解+设置触发距离
  • 新书推荐|Windows黑客编程技术详解
  • d²y/dx²; 偏导数问题 请问f1 f2是什么意思
  • HanLP分词命名实体提取详解
  • mysql 慢查询分析工具:pt-query-digest 在mac 上的安装使用 ...
  • (14)Hive调优——合并小文件
  • (14)学习笔记:动手深度学习(Pytorch神经网络基础)
  • (ctrl.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MDd_DynamicDebug”不匹配值“
  • (vue)el-checkbox 实现展示区分 label 和 value(展示值与选中获取值需不同)
  • (附源码)spring boot基于小程序酒店疫情系统 毕业设计 091931
  • (一)kafka实战——kafka源码编译启动
  • (一)Spring Cloud 直击微服务作用、架构应用、hystrix降级
  • (一)硬件制作--从零开始自制linux掌上电脑(F1C200S) <嵌入式项目>
  • *** 2003
  • **PyTorch月学习计划 - 第一周;第6-7天: 自动梯度(Autograd)**
  • ./configure、make、make install 命令
  • .NET Core MongoDB数据仓储和工作单元模式封装
  • .NET 服务 ServiceController
  • .考试倒计时43天!来提分啦!
  • /bin/bash^M: bad interpreter: No such file ordirectory
  • @Transactional 详解