python中BPY模块的导入错误 [英] Import Error for BPY module in python

查看:782
本文介绍了python中BPY模块的导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编写一个python脚本并在Blender上下文中执行它.但是它报告导入错误:没有名为"bpy"的模块".我尝试安装其他版本的Blender(即2.7.6),但似乎实际上在"blender-2.76-rc2-win64 \ 2.76 \ python \ lib"内实际上没有名为bpy的模块,这是python搜索的路径我想的模块.我签出了Blender的文档,但是没有明确的方法下载bpy.任何帮助将不胜感激.

I was trying to write a python script and execute it within blender context. But it reports 'Import Error : No module named "bpy"'. I tried installing another version of blender ( viz. 2.7.6 ) but as it appears there is actually no module named bpy inside "blender-2.76-rc2-win64\2.76\python\lib" , which is the path where python is searching for modules I suppose. I checked out the docs for blender but there is no explicit way of downloading bpy. Any help will be appreciated.

推荐答案

bpy模块是Blender的内置部分,可让python脚本访问Blender中使用的数据和运算符.此模块可用于在Blender本身(包括python解释器)中运行的脚本.通常无法从普通的python命令导入bpy模块,但是编译混合器模块.

The bpy module is a built-in part of blender that gives python scripts access to the data and operators used in blender. This module is available to scripts run within blender itself, which includes a python interpreter. The bpy module isn't normally available to import from a normal python command, but there is limited support to compile a blender module.

要使用bpy模块,您可以启动Blender并使用内置的 Python控制台,也可以在文本编辑器中输入或打开脚本,运行脚本按钮可用.特别是如果您从文本编辑器中运行脚本,则需要访问控制台控制台以获得错误报告.

To use the bpy module you can start blender and use the built in 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 to get error reports.

这篇关于python中BPY模块的导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆