Closed danli349 closed 1 month ago
Please install the most recent version of scvi-tools 1.2.0. We changed the API in (I'm guessing a bit here) 0.16.
@canergen Why when I use python -m pip install scvi-tools
to install scvi-tools
, I can only install scvi-tools 0.20.3
?
and can't import it:
import scvi
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 9
7 import pooch
8 import scanpy as sc
----> 9 import scvi
10 import torch
12 sc.logging.print_header()
File [~/miniconda3/lib/python3.8/site-packages/scvi/__init__.py:7](http://localhost:8888/~/miniconda3/lib/python3.8/site-packages/scvi/__init__.py#line=6)
4 import logging
6 from ._constants import REGISTRY_KEYS
----> 7 from ._settings import settings
9 # this import needs to come after prior imports to prevent circular import
10 from . import autotune, data, model, external, utils
File [~/miniconda3/lib/python3.8/site-packages/scvi/_settings.py:7](http://localhost:8888/~/miniconda3/lib/python3.8/site-packages/scvi/_settings.py#line=6)
4 from typing import Literal, Union
6 import torch
----> 7 from pytorch_lightning import seed_everything
8 from rich.console import Console
9 from rich.logging import RichHandler
File [~/miniconda3/lib/python3.8/site-packages/pytorch_lightning/__init__.py:40](http://localhost:8888/~/miniconda3/lib/python3.8/site-packages/pytorch_lightning/__init__.py#line=39)
37 from pytorch_lightning.trainer import Trainer # noqa: E402
39 # this import needs to go last as it will patch other modules
---> 40 import pytorch_lightning._graveyard # noqa: E402, F401 # isort: skip
42 __all__ = ["Trainer", "LightningDataModule", "LightningModule", "Callback", "seed_everything"]
44 # for compatibility with namespace packages
File [~/miniconda3/lib/python3.8/site-packages/pytorch_lightning/_graveyard/__init__.py:26](http://localhost:8888/~/miniconda3/lib/python3.8/site-packages/pytorch_lightning/_graveyard/__init__.py#line=25)
24 import pytorch_lightning._graveyard.trainer
25 import pytorch_lightning._graveyard.training_type
---> 26 import pytorch_lightning._graveyard.utilities # noqa: F401
File [~/miniconda3/lib/python3.8/site-packages/pytorch_lightning/_graveyard/utilities.py:25](http://localhost:8888/~/miniconda3/lib/python3.8/site-packages/pytorch_lightning/_graveyard/utilities.py#line=24)
17 def _get_gpu_memory_map() -> None:
18 # TODO: Remove in v2.0.0
19 raise RuntimeError(
20 "`pytorch_lightning.utilities.memory.get_gpu_memory_map` was deprecated in v1.5 and is no longer supported"
21 " as of v1.9. Use `pytorch_lightning.accelerators.cuda.get_nvidia_gpu_stats` instead."
22 )
---> 25 pl.utilities.memory.get_gpu_memory_map = _get_gpu_memory_map
AttributeError: partially initialized module 'pytorch_lightning' has no attribute 'utilities' (most likely due to a circular import)
I assume that you use Python 3.8. Please use at least Python 3.10 for the newest release. It looks like your torch installation is broken. Please set up a new environment and follow our installation guideline.
Hello
When I run the code in tutorial https://docs.scvi-tools.org/en/stable/tutorials/notebooks/atac/PeakVI.html
How can I solve this error?
Thanks a lot