TL;DR: sympy removed the with_metaclass helper from sympy.core.compatibility. Define the two-line helper locally or upgrade the package that does the old import.

## The error
```text
ImportError: cannot import name 'with_metaclass' from 'sympy.core.compatibility'
```

## Fix it
1. Replace the import with a local definition:
   ```python
   def with_metaclass(meta, *bases):
       class TemporaryClass(*bases, metaclass=meta):
           pass
       return TemporaryClass
   ```
   Expected: call sites using with_metaclass(...) keep working.
2. If the bad import is inside a third-party package, upgrade that package:
   ```
   pip install -U [the-package]
   ```
3. Verify the import that failed now works.

## When this applies
Use this when code does `from sympy.core.compatibility import with_metaclass` on a recent sympy.

## When it does not apply
If the error names a different compatibility helper, check whether sympy still ships it. If sympy itself will not import, reinstall it.

## Compatibility
Recent sympy versions where the helper was removed. The local definition works on all Python 3.

## Root cause
sympy.core.compatibility held Python 2/3 transition helpers. Once sympy went Python-3-only, the helpers were deleted, and anything still importing them breaks at import time.

## Edge cases
The six package also provides with_metaclass if you already depend on six. Grep for other sympy.core.compatibility imports when upgrading sympy; more helpers were removed in the same cleanup.