Change default environment of Python interpreter
Use pyenv to change the default version or execution mode of
the Python® interpreter. These changes are persistent across different MATLAB® sessions.
pe = pyenv returns details about the current (default)
Python environment as a PythonEnvironment object.
pe = pyenv('Version', changes the
default Python version on Microsoft®
Windows® platforms.version)
Note
MATLAB automatically loads Python when you type py.. You cannot change the interpreter after MATLAB loads Python. To change the interpreter, restart MATLAB, and then call commandpyenv.
specifies the full path to the Python executable. You can use this syntax on any platform or for repackaged
CPython implementation downloads.pe = pyenv('Version',executable)
pe = pyenv('ExecutionMode',
changes the default execution mode of the Python interpreter.executionMode)
pe = pyenv('Version',
changes the default version and execution mode of the interpreter.executable,'ExecutionMode',executionMode)