简体   繁体   English

Pyinstaller因Python FBX失败

[英]Pyinstaller fails with Python FBX

I wrote a simple test script for Python FBX from Autodesk ( http://www.autodesk.com/products/fbx/overview ). 我从Autodesk( http://www.autodesk.com/products/fbx/overview )编写了一个简单的Python FBX测试脚本。 It reads an .FBX file and prints out some information on the file's contents. 它读取一个.FBX文件,并打印出有关文件内容的一些信息。

It works fine when running the .py but when using Pyinstaller to turn it into an EXE, it fails with this error: 运行.py时,它工作正常,但使用Pyinstaller将其转换为EXE时,失败并显示此错误:

File "<string>", line 2, in <module>
File ".....\pyi_importers.py", line 409, in load_module
  module = imp.load_module(fullname, fp, filename, self._c_ext_tuple)
ImportError: No module named fbxsip

I have no idea what fbxsip is supposed to be. 我不知道fbxsip应该是什么。

It looks as though pyinstaller is not able to resolve the dependencies on the Autodesk SDK. 看起来pyinstaller无法解决对Autodesk SDK的依赖关系。

fbxsip.pyd is part of the Autodesk SDK. fbxsip.pyd是Autodesk SDK的一部分。

Most likely you will need to modify your spec to explicitly include fbxsip.pyd and fbx.pyd 您很可能需要修改您的规范以明确包含fbxsip.pyd和fbx.pyd

1) copy the FBX SDK to your Application directory 1)将FBX SDK复制到您的应用程序目录

App:
   ...
   fbx.pyd
   fbxsip.pyd
   FbxCommon.py

2) then when you import fbx, force python to import fbxsip even you don't need it 2)然后,当您导入fbx时,即使您不需要,也强制python导入fbxsip

from fbx import *
import fbxsip

maybe the first step is not necessary, but i didn't try it. 也许第一步不是必需的,但是我没有尝试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM