python 中的 BPY 模块导入错误

Import Error for BPY module in python

我试图编写一个 python 脚本并在 blender 上下文中执行它。但它报告 'Import Error : No module named "bpy"'。我尝试安装另一个版本的 blender(即 2.7.6),但看起来 "blender-2.76-rc2-win64.76\python\lib" 中实际上没有名为 bpy 的模块,我想这是 python 搜索模块的路径。我查看了 blender 的文档,但没有明确的下载 bpy 的方法。任何帮助将不胜感激。

bpy 模块是 blender 的内置部分,可让 python 脚本访问 blender 中使用的数据和运算符。该模块可用于 blender 本身的脚本 运行,其中包括一个 python 解释器。 bpy 模块通常不能从普通 python 命令导入,但对编译 blender module.

的支持有限

要使用 bpy 模块,您可以启动 blender 并使用内置 python console or you can type in or open a script in the text editor which has a run script button available. Particularly if you run scripts from the text editor you will want access to a console 获取错误报告。