首页 > 解决方案 > 在 Python 中导入搅拌机模块时如何修复错误

问题描述

当我将 bpy 导入 python 时出现以下错误代码,这是因为我需要安装搅拌机,或者我可以用另一种方式解决这个问题吗?

Color management: using fallback mode for management
BLT_lang_init: 'locale' data path for translations not found, continuing
AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead
bpy: couldnt find 'scripts/modules', blender probably wont start.
Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): c:\users\tgubs\.blenderpy\blender\source\blender\python\intern\bpy_rna.c:6662 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): c:\users\tgubs\.blenderpy\blender\source\blender\python\intern\bpy_rna.c:6662 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): c:\users\tgubs\.blenderpy\blender\source\blender\python\intern\bpy_rna.c:6662 pyrna_srna_ExternalType: failed to find 'bpy_types' module
F1106 16:58:18.372622 23956 utilities.cc:322] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
*** Check failure stack trace: ***

标签: pythonblender

解决方案


您需要将2.79文件夹移动到包含 python 可执行文件的目录。

只需进入您的 python 环境,进入 Scripts 目录,2.79从那里剪切文件夹并将其粘贴到包含 Conda Python 可执行文件的文件夹中。问题是版本文件夹(2.79当前)必须是 Python 可执行文件的兄弟。由于您所处的任何环境都没有位于脚本( ,等)python.exe旁边的文件,因此它正在抱怨,因为路径应该是(相对于尝试导入它的当前)并且找不到它.pipvenvbpy_types./2.79/scripts/modules/bpy_types.pypython.exe

Windows 是一个已知平台,其中这些脚本文件可能会有所不同,尤其是取决于您的环境。

简而言之:

找到文件夹2.79 从当前位置剪切它粘贴到包含的文件夹中python.exe

请看这个问题


推荐阅读