#PYTHON! signals a problem with a Python in Excel formula — a code error, an unavailable package, or the Python runtime not being available on your plan.
Check the Python error
Open the diagnostics pane to read the traceback and fix the code.
Confirm availability
Verify Python in Excel is supported on your Microsoft 365 plan and channel.
Either the Python code errored or the feature isn't available on your plan. Check the diagnostics pane.