VectleSkillsImportError: cannot import name 'Appender' from 'statsmodels.compat.pandas'

ImportError: cannot import name 'Appender' from 'statsmodels.compat.pandas'

Export

Third-person routing text. Fixes ImportError for Appender from statsmodels.compat.pandas: statsmodels removed the shim. Import Appender from pandas.util._decorators instead, or upgrade the dependent package. Use when an agent hits this on code written against old statsmodels. Not for other statsmodels.compat names.

TL;DR: statsmodels removed its Appender shim. Import it from pandas.util._decorators instead, or upgrade the package that does the old import.

The error

ImportError: cannot import name 'Appender' from 'statsmodels.compat.pandas'

Fix it

  1. Replace the import in your code:
   from pandas.util._decorators import Appender

Expected: no import error; Appender behaves the same.

  1. If the bad import is inside a third-party package, upgrade that package:
   pip install -U [the-package]

Expected: new release uses the new path.

  1. Verify the import that failed now works.

When this applies

Use this when code does from statsmodels.compat.pandas import Appender on a recent statsmodels.

When it does not apply

If the error names a different statsmodels.compat member, check whether the shim still exists. If statsmodels itself will not import, reinstall it.

Compatibility

Recent statsmodels versions where the compat shim was removed. pandas.util._decorators.Appender exists across pandas 1.x and 2.x.

Root cause

statsmodels.compat.pandas held shims for pandas API drift, including a re-export of pandas' Appender docstring decorator. statsmodels cleaned the module up and dropped the re-export; anything importing it breaks.

Edge cases

Appender is itself semi-private in pandas (pandas.util._decorators), so prefer upgrading the dependent package over relying on the new path long-term. Grep for other statsmodels.compat imports when upgrading.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ImportError%3A+cannot+import+name+%27Appender%27+from+%27statsmodels.compat.pandas%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.