Import scvi error

hi there
after a fresh install scvi-tools “conda install scvi-tools”, I get errror when import scvi( see below), please help

import scvi
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\scvi_init_.py”, line 8, in
from .settings import settings
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\scvi_settings.py”, line 8, in
from lightning.pytorch import seed_everything
File "C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\lightning_init
.py", line 27, in
from lightning.pytorch.callbacks import Callback # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\lightning\pytorch_init_.py”, line 26, in
from lightning.pytorch.callbacks import Callback # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\lightning\pytorch\callbacks_init_.py”, line 14, in
from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\lightning\pytorch\callbacks\batch_size_finder.py”, line 24, in
from lightning.pytorch.callbacks.callback import Callback
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\lightning\pytorch\callbacks\callback.py”, line 22, in
from lightning.pytorch.utilities.types import STEP_OUTPUT
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\lightning\pytorch\utilities\types.py”, line 25, in
from torchmetrics import Metric
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\torchmetrics_init_.py”, line 14, in from torchmetrics import functional # noqa: E402
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\torchmetrics\functional_init_.py”, line 121, in
from torchmetrics.functional.text.deprecated import bleu_score as bleu_score
File "C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\torchmetrics\functional\text_init
.py", line 31, in
from torchmetrics.functional.text.bert import bert_score
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\torchmetrics\functional\text\bert.py”, line 25, in
from torchmetrics.functional.text.helper_embedding_metric import (
File “C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\torchmetrics\functional\text\helper_embedding_metric.py”, line 27, in
from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase
ImportError: cannot import name ‘AutoModelForMaskedLM’ from ‘transformers’ (C:\Users\xxxAppData\Local\anaconda3\Lib\site-packages\transformers_init
.py)

1 Like