tutorial does not run -- version issues with scvi-tools
kiristern opened this issue · comments
Hello, I am trying to run the scgen_perturbation_prediction.ipynb tutorial but am having dependency issues, namely with scvi-tools
.
I created a new conda
env with the latest releases:
scgen 2.1.0
scvi-tools 1.0.4
When simply running the tutorial, on import scgen
, I got:
from ._scgenvae import SCGENVAE
File "~/miniconda3/envs/scgen/lib/python3.11/site-packages/scgen/_scgenvae.py", line 6, in <module>
from scvi.module.base import BaseModuleClass, LossRecorder, auto_move_data
ImportError: cannot import name 'LossRecorder' from 'scvi.module.base'
It appears as if LossRecorder
was renamed to LossOutput.
I simply changed LossRecorder
to LossOutput
but then kept getting new errors such as "Literal is deprecated, use typing instead" (again, just modified from typing import Literal
), but then more errors... i ended up just restarting and installing pip install git+https://github.com/theislab/scgen.git
development version, but now get the error:
scgen.SCGEN.setup_anndata(train_new, batch_key="condition", labels_key="cell_type")
"~/miniconda3/envs/scgen/lib/python3.11/site-packages/scvi/data/_utils.py", line 245, in _check_if_view
raise ValueError("Please run `adata = adata.copy()`")
ValueError: Please run `adata = adata.copy()`
I was wondering what is the last stable versions to run the tutorial without having to manually go through all these errors? Thanks!
I tried running the same tutorial via Google Colab as well and have the same dependencies issues.
Hi! This fork has resolved some of my issues, I hope it helps: https://github.com/szhorvat/scgen
I encountered this problem, too.
scgen.SCGEN.setup_anndata(train_new, batch_key="condition", labels_key="cell_type")
"~/miniconda3/envs/scgen/lib/python3.11/site-packages/scvi/data/_utils.py", line 245, in _check_if_view
raise ValueError("Please run `adata = adata.copy()`")
ValueError: Please run `adata = adata.copy()`
I finally solved it by adding ".copy()" to "train_new = train[~((train.obs["cell_type"] == "CD4T") & (train.obs["condition"] == "stimulated"))]" at the end