如何在Google Colab中使用Blender?

路西法

我正在尝试在Google colab上实施报告。它需要安装Blender并将其链接到/usr/local/bin/blender

他们的自述文件指出- (请安装Blender 2.79。无需从源代码进行构建,您只需下载预构建的二进制文件并在处链接即可/usr/local/bin/blender。)

但是我没有在Google colab上进行操作。任何帮助,将不胜感激。

普罗科

首先,Google Collab使用IPython交互式python shell(可以这么说)。IPython允许外壳程序分配,这意味着您可以从中执行外壳程序命令,这在Google Collab中也是可能的。

您需要做的就是下载Blender,然后将其链接到/usr/local/bin/blender除非存在问题相关已知问题libtcmalloc,否则(无论使用CPU还是GPU,都必须应用此修复程序)。因此,结束脚本如下所示:

import os
os.environ["LD_PRELOAD"] = ""

!apt remove libtcmalloc-minimal4
!apt install libtcmalloc-minimal4

os.environ["LD_PRELOAD"] = "/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4.3.0"

!wget https://download.blender.org/release/Blender2.79/blender-2.79-linux-glibc219-x86_64.tar.bz2
!tar -xf blender-2.79-linux-glibc219-x86_64.tar.bz2

# if you still get any errors regarding LD_PRELOAD you can check whether a good path is applied (if the version of library has not changed)
!dpkg -L libtcmalloc-minimal4 

!ln -s /content/blender-2.79-linux-glibc219-x86_64/blender /usr/local/bin/blender
!blender -v

我设法正常运行blender并获得了正确的版本。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章