Hi, I am new to scvi.
I used jupyterlab and my python version is 3.9.5.
I installed scvi following the tutorial.
pip install scvi-tools
I am able to import scvi to my jupyterlab.
However, when I tried to use it, it reminds me it does not has this attribute or that attribute.
adata = scvi.data.heart_cell_atlas_subsampled() Error: module ‘scvi’ has no attribute ‘data’
scvi.settings.seed = 420 Error: module ‘scvi’ has no attribute ‘settings’
Seems that my scvi contains nothing.
Could anyone give me some help?
Can you run
pip show scvi-tools and paste the output here?
I ran it and the output is:
Summary: Deep probabilistic analysis of single-cell omics data.
Home-page: GitHub - scverse/scvi-tools: Deep probabilistic analysis of single-cell omics data
Author: The scvi-tools development team
Requires: anndata, docrep, flax, h5py, ipywidgets, jax, jaxlib, mudata, numpy, numpyro, openpyxl, optax, pandas, pyro-ppl, pytorch-lightning, rich, scikit-learn, torch, torchmetrics, tqdm
Do you have a file named scvi.py in the directory where you’re running your notebook? If so, that might be the issue, try deleting or moving that file elsewhere, then re-start your jupyter kernel and
import scvi again.
When you type
scvi at the Python prompt you should get:
<module 'scvi' from '<your_path>/lib/python3.7/site-packages/scvi/__init__.py'>
Thank you so much. Problem solved.
I doubt this happened because when I installed scvi-tools the first time, I used the wrong command: pip install scvi
although I uninstalled scvi later and installed scvi-tools, I was not able to correctly import scvi-tools.
After I uninstall all scvi, scvi-tools from my global and virtual environment and reinstalled scvi-tools, problem solved.