PythonEnvironment
Python environment information
Description
PythonEnvironment
objects contain information about the settings
and status of the Python® interpreter. MATLAB® communicates with the interpreter when you call a py.
command. Python environment information is persistent across different MATLAB sessions.
Creation
To create a PythonEnvironment
object or change the settings, call pyenv
.
MATLAB selects and loads a Python interpreter when you type a Python expression from MATLAB using the py
namespace, for example,
py.list
. To change the interpreter:
If Python is loaded in
InProcess
ExecutionMode
, then restart MATLAB and callpyenv
with the new version information or execution mode.If Python is loaded in
OutOfProcess
mode, thenterminate
the process associated with the Python interpreter by calling
before callingterminate
pyenv
with the new version information or execution mode.
Properties
Object Functions
terminate | Terminate process associated with Python interpreter |
Examples
Limitations
Saving (serializing)
PythonEnvironment
objects to a MAT file is not supported.
Version History
Introduced in R2019b