AttributeError: module 'cell2location.models' has no attribute 'RegressionGeneBackgroundCoverageTorch'.
However, when I import cell2location, there is no error.
Here is my cell2location information:
%pip show cell2location
Name: cell2location
Version: 0.1.3
Summary: cell2location: High-throughput spatial mapping of cell types
Home-page: https://github.com/BayraktarLab/cell2location
Author: Vitalii Kleshchevnikov, Artem Shmatko, Emma Dann, Artem Lomakin, Alexander Aivazidis
Author-email: vitalii.kleshchevnikov@sanger.ac.uk
License: Apache License, Version 2.0
Location: ./.conda/envs/myjupyter/lib/python3.10/site-packages
Requires: numpy, opencv-python, pandas, pyro-ppl, scanpy, scvi-tools, torch
Required-by:
Note: you may need to restart the kernel to use updated packages.
Problem
I am following this tutorial (https://github.com/BayraktarLab/cell2location/blob/master/docs/notebooks/cell2location_estimating_signatures.ipynb) and failed to import
run_regression
modulesHere are my codes and error information
from cell2location import run_regression
ImportError Traceback (most recent call last) Cell In[15], line 2 1 # Run the pipeline: ----> 2 from cell2location import run_regression
ImportError: cannot import name 'run_regression' from 'cell2location' (./.conda/envs/myjupyter/lib/python3.10/site-packages/cell2location/init.py)
When I tried to run
help(cell2location.models.RegressionGeneBackgroundCoverageTorch)
, I also got an error:AttributeError Traceback (most recent call last) Cell In[17], line 1 ----> 1 help(cell2location.models.RegressionGeneBackgroundCoverageTorch)
AttributeError: module 'cell2location.models' has no attribute 'RegressionGeneBackgroundCoverageTorch'.
However, when I
import cell2location
, there is no error. Here is mycell2location
information:%pip show cell2location
Name: cell2location Version: 0.1.3 Summary: cell2location: High-throughput spatial mapping of cell types Home-page: https://github.com/BayraktarLab/cell2location Author: Vitalii Kleshchevnikov, Artem Shmatko, Emma Dann, Artem Lomakin, Alexander Aivazidis Author-email: vitalii.kleshchevnikov@sanger.ac.uk License: Apache License, Version 2.0 Location: ./.conda/envs/myjupyter/lib/python3.10/site-packages Requires: numpy, opencv-python, pandas, pyro-ppl, scanpy, scvi-tools, torch Required-by: Note: you may need to restart the kernel to use updated packages.Any suggestions on how to do troubleshooting?
Best, LC