Terminate process associated with Python interpreter
terminate( terminates the process
associated with the Python® interpreter if the ExecutionMode
OutOfProcess. Throws an error if the property value is
MATLAB® automatically removes standalone Python references from the workspace after calling
The best practice is to call
pyenv with an
updated version value immediately after calling
terminate. If you
assign a Python reference to a MATLAB data structure, then the Python reference is a deleted handle after calling
you refer to a deleted handle, then MATLAB launches a new Python process, to acquire information from Python regarding its type. In this case, recall the
Pressing Ctrl+C does not terminate the out-of-process command.
Suppose that you created this
ans = PythonEnvironment with properties: Version: "2.7" Executable: "C:\Python27\pythonw.exe" Library: "C:\windows\system32\python27.dll" Home: "C:\Python27" Status: Loaded ExecutionMode: OutOfProcess ProcessID: "8196" ProcessName: "MATLABPyHost"
Terminate the process.
Display information about the current environment.
ans = PythonEnvironment with properties: Version: "2.7" Executable: "C:\Python27\pythonw.exe" Library: "C:\windows\system32\python27.dll" Home: "C:\Python27" Status: Terminated ExecutionMode: OutOfProcess
pe — Python environment
Python environment, specified as a
Introduced in R2019b