scvi-tools: Importerror for scVI in tutorials

Describe the bug

Importerror for scVI.

To reproduce

Execute your very own tutorial: https://colab.research.google.com/github/scverse/scvi-tutorials/blob/0.15.3/api_overview.ipynb

ImportError                               Traceback (most recent call last)

[<ipython-input-4-c98868e3b7fa>](https://localhost:8080/#) in <module>()
----> 1 import scvi
      2 import scanpy as sc
      3 import matplotlib.pyplot as plt
      4 
      5 sc.set_figure_params(figsize=(4, 4))

12 frames

[/usr/local/lib/python3.7/dist-packages/torchtext/vocab/vocab_factory.py](https://localhost:8080/#) in <module>()
      2 from typing import Dict, Iterable, Optional, List
      3 from collections import Counter, OrderedDict
----> 4 from torchtext._torchtext import (
      5     Vocab as VocabPybind,
      6 )

ImportError: /usr/local/lib/python3.7/dist-packages/torchtext/_torchtext.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtERKSt10shared_ptrIS0_EPSo

Versions:

Latest stable

I suspect that this is some missmatch of incompatible versions of PyTorch and torchtext.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (7 by maintainers)

Most upvoted comments

Done.

!pip install --quiet scvi-colab
from scvi_colab import install
install()

This will install scvi-tools for you in google colab. We will update all the tutorials in a patch release to reflect this.

Indeed the problem is solved if the very first thing that is done is pip install pyro-ppl==1.8.0.

@Zethson I think the solution is a scvi-colab package that is pip installed and runs the installation steps for colab…