HAS_PYTHON checks if Python is available in the current environment.

https://www.mathworks.com/support/requirements/python-compatibility.html

function y = has_python()

try  %#ok<TRYNC>
  r = matlabRelease();
  if ispc && r.Release == "R2026a" && r.Stage == "prerelease"
    % avoid python due to bug
    y = false;
    return
  end
end

y = ~isempty(stdlib.python_version());

end

%!assert(~stdlib.has_python())