scanpy/api/pl.py "cannot import name stacked_violin" from 'scanpy.plotting._anndata'
See original GitHub issue- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of scanpy.
Minimal code sample (that we can copy&paste without having any data)
import scanpy.api as sc
File "./scanpy_normalization.py", line 4, in <module>
import scanpy.api as sc
File "/usr/local/lib/python3.8/site-packages/scanpy/api/__init__.py", line 27, in <module>
from . import pl
File "/usr/local/lib/python3.8/site-packages/scanpy/api/pl.py", line 1, in <module>
from ..plotting._anndata import scatter, violin, ranking, clustermap, stacked_violin, heatmap, dotplot, matrixplot, tracksplot
ImportError: cannot import name 'stacked_violin' from 'scanpy.plotting._anndata' (/usr/local/lib/python3.8/site-packages/scanpy/plotting/_anndata.py)
This is with the latest version of scanpy. I looked at the code and scanpy/apt/pl.py still has from …plotting._anndata import scatter, violin, ranking, clustermap, stacked_violin, heatmap, dotplot, matrixplot, tracksplot, even as the plotting library has been refactored and the dotplot, matrixplot and stacked_violin are now in separate files.
I tested this a few days ago and it was working fine then, the update to anndata probably happened in the last couple of days
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
scanpy/api/pl.py "cannot import name stacked_violin ... - GitHub
I looked at the code and scanpy/apt/pl.py still has from ..plotting._anndata import scatter, violin, ranking, clustermap, stacked_violin, ...
Read more >ImportError: cannot import name 'stacked_violin' from 'scanpy ...
This is definitely a bug in the module and seems like its stemming from the latest version that you must have upgraded to....
Read more >scanpy.pl.stacked_violin — Scanpy 1.9.1 documentation
Makes a compact image composed of individual violin plots (from violinplot() ) stacked on top of each other. Useful to visualize gene expression...
Read more >Clustering 3K PBMCs with Scanpy - Galaxy Training!
How to cluster cells in single-cell RNA-Seq data? How cell type annotation can be assigned to cell clusters? Objectives: Describe an AnnData object...
Read more >scanpy · PyPI
Single-Cell Analysis in Python. ... Scanpy's plotting module can be viewed similar to Seaborn: an extension of matplotlib that allows visualizing operations ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

nm, downgrading to 1.5.1 fixed my problem. Thanks!
Hi I had this problem as well with 1.6.0 it was triggered by scanpy’s test code.
I ended up with this patch to get the tests to run successfully.