Initializing help system before first use

pyunload

pyunload


Purpose
Release the Python interpreter and its resources.
Synopsis
procedure pyunload
Example
The following example releases the Python interpreter:
 pyunload
Further information
1. The use of this procedure is optional: the Python interpreter is automatically released at the end of a model execution. However, you may prefer to release it sooner to free resources allocated by Python.
2. After unloading the interpreter it cannot be reinitialized in the same Mosel instance. This is due to a bug in Python's finalization function and its extension modules. For example, NumPy and pandas do not work after reinitializing the interpreter in the same process, i.e., in the same Mosel instance. See https://docs.python.org/3/c-api/init.html#c.Py_FinalizeEx and https://github.com/numpy/numpy/issues/8097 for more details.
Related topics
Module
python3