我在anaconda环境中运行python 3.7.3。
在无法从pip和conda软件包中使Blender bpy模块工作之后,我从~\Documents\blender-git
我将构建的文件(“ bpy.pyd”,blender“ 2.8”文件夹和所有“ api-ms-win-core ...” dll文件)复制到环境文件夹~\Anaconda3\envs\myenv\
中,然后继续编写我的应用程序,该应用程序运行时没有任何错误。
Python应用程序是从Anaconda Prompt的~\Documents\PythonProjects\PolyReduction
文件夹中运行的,并已激活conda环境。
我已经尝试使用pyinstaller将这个应用程序打包为可执行文件,方法是在激活conda环境的情况下从Anaconda Prompt运行以下命令。
pyinstaller -i img.ico -F polyreduce.py
可以正确编译。
运行我的应用程序polyreduce.exe时,我得到了
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\raptop\Documents\blender-git\blender\source\blender\python\intern\bpy_rna.c:7053 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\raptop\Documents\blender-git\blender\source\blender\python\intern\bpy_rna.c:7053 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\raptop\Documents\blender-git\blender\source\blender\python\intern\bpy_rna.c:7053 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\raptop\Documents\blender-git\blender\source\blender\python\intern\bpy_rna.c:7053 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): C:\Users\raptop\Documents\blender-git\blender\source\blender\python\intern\bpy_rna.c:7053 pyrna_srna_ExternalType: failed to find 'bpy_types' module
F0626 21:23:53.515146 3064 utilities.cc:322] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
*** Check failure stack trace: ***
PS C:\Users\raptop\Documents\PythonProjects\PolyReduction\dist> ./polyreduce.exe
Color management: using fallback mode for management
Color management: Error could not find role data role.
Color management: scene view "Filmic" not found, setting default "Standard".
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\raptop\Documents\blender-git\blender\source\blender\python\intern\bpy_rna.c:7053 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
这使我感到困惑,因为:
我希望通过将所有依赖项并排放置在可执行文件的相对路径中,或者将它们全部打包在可执行文件中来工作。我怎样才能做到这一点?