pyenv
Description
Use pyenv
to change the default version or execution mode of
the Python® interpreter. These changes are persistent across different MATLAB® sessions.
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 command
pyenv
.
pyenv
displays details about the current (default) Python environment.
pyenv(
specifies parameters for
setting the Python environment. For example, Name,Value
)pyenv(Version="3.10")
changes
the default Python version on Microsoft®
Windows® platforms to 3.10.
pe = pyenv(___)
additionally returns environment
details as a PythonEnvironment
object. Use this syntax with any of the arguments in
previous syntaxes.
Examples
Input Arguments
Version History
Introduced in R2019b