Compiled Matlab Python module doesn't work with Windows App store Python

The generated Python module using mcc or compiler.build.pythonPackage does not work on the Python environment installed by the Windows App Store.
It works fine on the "official" Python environment obtained from python.org and on environments installed using conda/Anaconda.
Using the environment (Python 3.8.10) installed by the Windows App Store, it gives this error:
Traceback (most recent call last):
File "makesqrSample1.py", line 13, in <module>
my_MagicSquarePkg = MagicSquarePkg.initialize()
File "C:\Users\x\src\py_mat_magic\MagicSquarePkgpythonPackage\MagicSquarePkg\__init__.py", line 322, in initialize
return _pir.initialize_package()
File "C:\Users\x\src\py_mat_magic\MagicSquarePkgpythonPackage\MagicSquarePkg\__init__.py", line 270, in initialize_package
package_handle.initialize()
File "C:\Program Files\MATLAB\R2021a\toolbox\compiler_sdk\pysdk_py\matlab_pysdk\runtime\deployablepackage.py", line 37, in initialize
mcr_handle = self.__cppext_handle.startMatlabRuntimeInstance(self.__ctf_path)
SystemError: class foundation::core::except::Exception<class MCR::mclmcr::MCLMCR_UNKNOWN_ERROR_INITIALIZING_MCR,class pysdk_runtime::RuntimeException,void>
This error can be reproduced with the attached files. First run compile_it.m and then run run_it.bat (after installing Python from the Windows App store https://www.microsoft.com/en-gb/p/python-38/9mssztt1n39l ).

3 件のコメント

Azim
Azim 2022 年 9 月 26 日
I'm getting the same error. Did you have the MATLAB complier and the MATLAB Runtime use compatible versions?
Azim
Azim 2022 年 9 月 27 日
Switching to the "official" Python environment also solved this issue for me. Thanks!
Duc Le
Duc Le 2022 年 9 月 27 日
Yeah. I raised a service request and Mathworks said they don't support the windows app store version - and amended the docs to say it: "MATLAB does not support CPython versions installed from the Microsoft® store." (https://www.mathworks.com/help/matlab/matlab_external/install-supported-python-implementation.html)

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler SDK についてさらに検索

質問済み:

2021 年 5 月 18 日

コメント済み:

2022 年 9 月 27 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by