htfa.set_autoinstall¶
- htfa.set_autoinstall(enabled)[source]¶
Turn on-demand installation of optional dependencies on or off.
By default a missing optional dependency (for example matplotlib for plots or pillow for 2D images) is installed with pip the first time it is needed. The
HTFA_AUTO_INSTALLenvironment variable (0,falseornoturns it off) sets the default; this function overrides the variable for the current process.- Parameters:
- enabledbool
Trueallows installation;Falsemakes a missing dependency raiseImportErrorwith thepip installcommand to run.
Examples
>>> import htfa >>> htfa.set_autoinstall(False) >>> from htfa._lazy import autoinstall_enabled >>> autoinstall_enabled() False >>> htfa.set_autoinstall(True)