フィルターのクリア

CPython error when running compiled application containing python module

8 ビュー (過去 30 日間)
Xinzhi Jiang
Xinzhi Jiang 2022 年 1 月 23 日
編集済み: Xinzhi Jiang 2022 年 1 月 24 日
Hi! I built a small Matlab standalone application (because I want to share it with others who don't have Matlab in their laptops), and inside the application I call a custom python module (a .py file which I packed along when I compiled the application).
Issue
When I test the compiled .exe file in my laptop, it works. However, it shows the following error when I try to run it in another laptop:
"Python commands require a supported version of CPython"
In the second laptop, python 3.9 is already installed (not from Microsoft Store but python.org page) and can be used in system prompt; the needed python distribution as well. Therefore, we wonder what can be the reason of that error message and what we should do?
Any help/advice will be greatly appreciated!
More information
My laptop:
  • MATLAB r2021a; python 3.8; windows 10.
  • The .exe file from folder "for redistribution" is sent to the other laptop.
The second laptop:
  • It has MATLAB r2018 (though I believe to run the .exe will not need a MATLAB installation?); python 3.9; windows 10.
  • Runtime is installed when we tried to run the .exe for the first time.

採用された回答

Xinzhi Jiang
Xinzhi Jiang 2022 年 1 月 24 日
Problem solved: python 3.9 is not supported until Matlab R2021b. Installing python 3.8 in the second laptop solved the issue.
Though the answer turns out to be pretty basic (and stupid), I will keep this post in case someone has similar queries in future.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by