ImportError: cannot import name '_centered' from 'scipy.signal.signaltools'
Third-person routing text. Fixes ImportError for _centered from scipy.signal.signaltools: a private scipy helper removed in newer scipy that old kats versions import. Upgrade kats to a fixed release or patch the import. Use when an agent hits this importing kats with new scipy. Not for user code.
TL;DR: your kats version imports a private scipy helper (_centered) that newer scipy removed. Upgrade kats to a release that no longer uses it, or pin scipy to an older version as a workaround.
The error
ImportError: cannot import name '_centered' from 'scipy.signal.signaltools'Fix it
Upgrade kats:
pip install -U katsExpected: installs a kats release fixed for modern scipy.
Verify:
python -c "import kats; print(kats.__version__)"Expected: imports cleanly.
Workaround if you cannot upgrade kats: pin scipy to a version that still ships the private helper:
pip install "scipy<1.11"Expected: the old import path works again.
When this applies
Use this when import kats raises this error and scipy is recent.
When it does not apply
If your own code imports _centered, copy the tiny helper into your project instead of depending on scipy internals. If kats is already current, reinstall it.
Compatibility
kats releases before the scipy-compat fix; scipy 1.11+ where the private helper is gone.
Root cause
_centered was a private (underscore-prefixed) helper inside scipy.signal.signaltools, never public API. scipy removed it during cleanup, and kats imported it directly, so kats broke at import time on new scipy.
Edge cases
Pinning old scipy can break other packages that need new scipy; upgrading kats is the durable fix. Private-name imports (leading underscore) are always at risk; treat any of them as a bug in the importing package.