Applies To
Excel for Microsoft 365 Excel for the web

#PYTHON errors are returned by Python in Excel formulas when a formula can't run properly. See below for specific cases.

An error occurred in an external calculation service.

There is an issue with the Python initialization settings. Open the initialization settings task pane to resolve the error. For more information, see Python in Excel initialization settings.​​​​​​​

Python in Excel supports importing data from an Excel worksheet or a Power Query data source. To protect your security, common external data functions in Python, such as pandas.read_csv and pandas.read_excel, aren't compatible with Python in Excel. To import external data, use the Get & Transform feature in Excel to access Power Query. For more information, see Use Power Query to import data for Python in Excel.

An error was returned by the Python interpreter as a result of running the Python code.

We were unable to execute your Python code. Please check the Python formula for errors and try again.

Something went wrong with the service. Please try again.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.