Why am I unable to launch the Python executable that was created on a CTF from MATLAB Complier SDK?
4 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2022-1-28
编辑: MathWorks Support Team
2025-4-16
I have an application in Python that uses MATLAB functions created from MATLAB Complier SDK that is running without issue.
However, when I attempt to compile this application using PyInstaller, I am unable to run the executable created by PyInstaller as I receive the following error message:
File "C:\MATLAB\R2020a\toolbox\compiler_sdk\pysdk_py\matlab_pysdk\runtime\deployablepackage.py", line 33, in initialize
mcr_handle = self.__cppext_handle.startMatlabRuntimeInstance(self.__ctf_path)
SystemError: Cannot find CTF archive 'AppData\Local\...\[LibraryName]\[LibraryName].ctf'.
What does this error mean, and how can I fix this issue?
采纳的回答
MathWorks Support Team
2025-4-16
编辑:MathWorks Support Team
2025-4-16
By default, PyInstaller will not include the CTF file in the executable that it creates. To resolve this issue, you must create a SPEC file to instruct PyInstaller to include your CTF.
For an explanation of how to do this, please see the following MATLAB Answers post which gives an example of how to create a SPEC file for this purpose.
Additionally, PyInstaller has some documentation about SPEC files that may help resolve this error.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!