CPython error when running compiled application containing python module

8 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Introduction 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