We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dear cell2location team, I am trying to do analyze Visium data I have but I can't successfully import the library. I am running the following code:
import os os.environ["THEANO_FLAGS"] = 'device=cuda,floatX=float32,force_device=True import cell2location
But I am getting the following error:
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Input In [6], in <cell line: 3>() 1 import os 2 os.environ["THEANO_FLAGS"] = 'device=cuda,floatX=float32,force_device=True' ----> 3 import cell2location File ~/miniconda3/lib/python3.9/site-packages/cell2location/__init__.py:5, in <module> 2 from pyro.distributions.transforms import SoftplusTransform 3 from torch.distributions import biject_to, transform_to ----> 5 from .run_c2l import run_cell2location 6 from .run_colocation import run_colocation 7 from .run_regression import run_regression File ~/miniconda3/lib/python3.9/site-packages/cell2location/run_c2l.py:18, in <module> 15 import scipy 16 import theano ---> 18 import cell2location.models as models 19 import cell2location.plt as c2lpl 20 from cell2location.cluster_averages import compute_cluster_averages, select_features File ~/miniconda3/lib/python3.9/site-packages/cell2location/models/__init__.py:1, in <module> ----> 1 from ._cell2location_model import Cell2location 2 from .downstream import CoLocatedGroupsSklearnNMF 3 from .pymc3.LocationModelLinearDependentWMultiExperimentLocationBackgroundNormGeneAlpha import ( 4 LocationModelLinearDependentWMultiExperimentLocationBackgroundNormGeneAlpha, 5 ) File ~/miniconda3/lib/python3.9/site-packages/cell2location/models/_cell2location_model.py:11, in <module> 9 from pyro import clear_param_store 10 from pyro.nn import PyroModule ---> 11 from scvi import _CONSTANTS 12 from scvi.data._anndata import get_from_registry 13 from scvi.model.base import BaseModelClass, PyroSampleMixin, PyroSviTrainMixin ImportError: cannot import name '_CONSTANTS' from 'scvi' (/Users/elisulvarang/miniconda3/lib/python3.9/site-packages/scvi/__init__.py)
I do have scvi-tools installed, this is the output when I run print(scvi.__version__): 0.15.4
print(scvi.__version__)
0.15.4
Same thing with pyro: print(pyro.__version__) 1.8.0
print(pyro.__version__)
1.8.0
I do not get any errors when I want to import any of these two libraries.
And this is the output when I run python -V: Python 3.9.7
python -V
Python 3.9.7
Thanks!
The text was updated successfully, but these errors were encountered:
Hi @elisulvaran
Please make sure that you install cell2location as described in README https://github.com/BayraktarLab/cell2location#installation and follow the latest tutorial https://cell2location.readthedocs.io/en/latest/notebooks/cell2location_tutorial.html. It could help to create a clean conda environment by following those installation steps and theano options are no longer relevant. The error you observe originates from a version mismatch between cell2location and scvi-tools which should go away if you recreate conda environemnt.
Sorry, something went wrong.
Also good to try this solution #142 (comment)
No branches or pull requests
Dear cell2location team,
I am trying to do analyze Visium data I have but I can't successfully import the library. I am running the following code:
But I am getting the following error:
I do have scvi-tools installed, this is the output when I run
print(scvi.__version__)
:0.15.4
Same thing with pyro:
print(pyro.__version__)
1.8.0
I do not get any errors when I want to import any of these two libraries.
And this is the output when I run
python -V
:Python 3.9.7
Thanks!
The text was updated successfully, but these errors were encountered: