Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: metaclass conflict: matplotlib v3.7.0 is incompatible with scanpy #2411

Closed
3 tasks done
thetorpedodog opened this issue Feb 14, 2023 · 1 comment · Fixed by #2414 or theislab/spapros#254
Closed
3 tasks done
Labels

Comments

@thetorpedodog
Copy link
Contributor

thetorpedodog commented Feb 14, 2023

  • 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 added a commit to single-cell-data/TileDB-SOMA that referenced this issue Feb 14, 2023
matplotlib just released v3.7, and unfortunately it introduced an
incompatibility with scanpy:

scverse/scanpy#2411

Excluding v3.7 works around this issue. This workaround can be removed
once scanpy itself excludes v3.7, or if scanpy fixes the root cause.
@thetorpedodog thetorpedodog changed the title matplotlib v3.7.0 is incompatible with scanpy due to metaclass conflict TypeError: metaclass conflict: matplotlib v3.7.0 is incompatible with scanpy Feb 14, 2023
thetorpedodog added a commit to single-cell-data/TileDB-SOMA that referenced this issue Feb 14, 2023
matplotlib just released v3.7, and unfortunately it introduced an
incompatibility with scanpy:

scverse/scanpy#2411

Excluding v3.7 works around this issue. This workaround can be removed
once scanpy itself excludes v3.7, or if scanpy fixes the root cause.
RemyLau added a commit to krishnanlab/obnb that referenced this issue Feb 14, 2023
* restrict matplotlib below 3.7 to scanpy plotting module error

scverse/scanpy#2411

* minor edit
@grst grst added the Bug 🐛 label Feb 14, 2023
carsten-jahn added a commit to Bayer-Group/cellenium that referenced this issue Feb 14, 2023
@thetorpedodog
Copy link
Contributor Author

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.

KenjiKamimoto-wustl122 added a commit to morris-lab/CellOracle that referenced this issue Feb 14, 2023
Change matplotlib version specification due to the issuehttps://github.com/scverse/scanpy/issues/2411
KenjiKamimoto-wustl122 added a commit to morris-lab/CellOracle that referenced this issue Feb 14, 2023
Change matplotlib version specification due to the issuehttps://github.com/scverse/scanpy/issues/2411
aryarm added a commit to biom262/cmm262-notebook that referenced this issue Feb 18, 2023
lazappi added a commit to theislab/atlas-feature-selection-benchmark that referenced this issue Feb 20, 2023
Version >= 3.7 is incompatiable with scanpy, see scverse/scanpy/issues/2411
abearab added a commit to ArcInstitute/ScreenPro2 that referenced this issue Dec 14, 2023
kmaherx added a commit to wanglab-broad/spin that referenced this issue Apr 30, 2024
scanpy dependencies set with >=, so have to explicitly select dependencies that we want below a certain value (e.g. numba).
matplotlib>3.7 has import issues (scverse/scanpy#2411), so we also specify that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants