- The target machine must have a supported version of Python installed.
- The installed version of Python must be discoverable by MATLAB.
- If the py. command is calling a custom Python module, than it must be on the Python search path.
Is it possible to compile MATLAB programs that contain Python code using MATLAB Compiler?
28 views (last 30 days)
Show older comments
MathWorks Support Team
on 12 Mar 2018
Edited: MathWorks Support Team
on 15 Nov 2023 at 21:30
I tried compiling my MATLAB program with Python code into a standalone application, but got the following error message when running it:
Undefined variable "py" or function "py.command"
Accepted Answer
MathWorks Support Team
on 15 Nov 2023 at 0:00
Edited: MathWorks Support Team
on 15 Nov 2023 at 21:30
Yes, this workflow is supported.
But please pay attention to what mentioned in the link below before compiling your code:
Some possible causes for this error are:
0 Comments
More Answers (0)
See Also
Categories
Find more on Python Package Integration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!