如何将共享对象文件转换为 python 文件

How to convert shared object file into python file

我有一个名为 bpy.so 的文件(blender python 文件)。我需要将其转换为 bpy.py,以便我可以将其导入 python。

你不知道。 file.py 表示 python 脚本,而 file.so 表示二进制文件。两者都是 python 模块,可以使用 import file.

导入

如果您已将 blender as a python module and you can't import it, that means you have the module in the wrong location. It would normally be installed in the same folder as your other python modules, you can also add a path 构建到 sys.path 或环境变量 PYTHONPATH 以便为模块使用额外的文件夹。

另请注意,blender 链接到特定的 python 版本,请检查您使用的 python 版本是否与一个 blender 模块的构建版本相同。