`TypeError: metaclass conflict`: matplotlib v3.7.0 is incompatible with scanpy
thetorpedodog opened this issue · 1 comments
thetorpedodog commented
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of scanpy.
- Updated: I have confirmed this bug exists on the master branch of scanpy.
Minimal code sample
Start from a fresh venv. (Tested on Python 3.9.2 on Debian Bullseye.)
(new-venv) $ pip install scanpy==1.9.1
Then from within that venv:
import scanpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../site-packages/scanpy/__init__.py", line 16, in <module>
from . import plotting as pl
File ".../site-packages/scanpy/plotting/__init__.py", line 1, in <module>
from ._anndata import (
File ".../site-packages/scanpy/plotting/_anndata.py", line 28, in <module>
from . import _utils
File ".../site-packages/scanpy/plotting/_utils.py", line 35, in <module>
class _AxesSubplot(Axes, axes.SubplotBase, ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
Versions
You can't get to scanpy.logging.print_versions()
on account of the crash.
thetorpedodog commented
To users: you can work around this in your environments by installing the previous version of matplotlib, for example with:
$ pip install 'matplotlib<3.7'
and/or adding a similar version specification to your pyproject.toml
/setup.py
/equivalent file, like single-cell-data/TileDB-SOMA@0bc97e8.