BayraktarLab / cell2location

Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics (cell2location model)
https://cell2location.readthedocs.io/en/latest/
Apache License 2.0
321 stars 58 forks source link

cannot import name 'run_regression' from 'cell2location' #289

Closed limin321 closed 1 year ago

limin321 commented 1 year ago

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 modules

Here 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 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.

Any suggestions on how to do troubleshooting?

Best, LC

vitkl commented 1 year ago

Duplicate https://github.com/BayraktarLab/cell2location/issues/208