Package Python Applications from Command Line
MATLAB® Compiler SDK™ cannot package MATLAB code that uses the MATLAB Python® interface with in-process execution mode.
You can package Python applications at the MATLAB prompt or your system prompt using either of these commands.
Execute Compiler Projects with
deploytool command has two flags that invoke one of the compiler apps
to package an already existing project without opening a window.
-build— Invoke the correct compiler app to build the project but not generate an installer.
-package— Invoke the correct compiler app to build the project and generate an installer.
deploytool -package magicsquare generates
the binary files defined by the
and packages them into an installer that you can distribute to others.
Package a Python Application with
mcc command invokes MATLAB
Compiler to create a deployable application at the command prompt and provides
fine-level control while packaging the application. It does not package the results
in an installer.
To invoke the compiler to generate a Python application, use the
mcc. This flag creates a
Python package named
packageName with methods for
each of the provided MATLAB functions.
For packaging Python applications, you can also use the following options.
|Add any files on the path to the generated binary.
|Specify the folder into which the results of packaging are written.
Differences Between Compiler Apps and Command Line
You perform the same functions using the compiler apps, a
function, or the
mcc command-line interface. The interactive menus and
dialog boxes used in the compiler apps build
mcc commands that are
customized to your specification. As such, your MATLAB code is processed the same way as if you were packaging it using
If you know the commands for the type of application you want to deploy and do not require
an installer, it is faster to execute either
mcc than go through the compiler app workflow.
Compiler app advantages include:
You can perform related deployment tasks with a single intuitive interface.
You can maintain related information in a convenient project file.
Your project state persists between sessions.
You can load previously stored compiler projects from a prepopulated menu.
You can package applications for distribution.