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
324 stars 58 forks source link

ModuleNotFoundError in singularity image in version cell2location-v0.06-alpha.sif #137

Closed CeliaLerma closed 2 years ago

CeliaLerma commented 2 years ago

Hi,

I am trying to run the new tutorial of cell2location in the latest singularity image version (cell2location-v0.06-alpha.sif) and I am encountering this problem:

singularity shell cell2location-v0.06-alpha.sif
python
import cell2location
from cell2location.utils.filtering import filter_genes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cell2location.utils'

Am I using a wrong image? Which one should I use? I have also tried to run it using v0.05 and it still does not work.

Thank you for your time.

vitkl commented 2 years ago

Please don't use the singularity image for now. Follow the installation instructions in the readme - which should generally work.

On Tue, 29 Mar 2022, 13:49 CeliaLerma, @.***> wrote:

Hi,

I am trying to run the new tutorial of cell2location in the latest singularity image version (cell2location-v0.06-alpha.sif) and I am encountering this problem:

singularity shell cell2location-v0.06-alpha.sif python import cell2location from cell2location.utils.filtering import filter_genes Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'cell2location.utils'

Am I using a wrong image? Which one should I use? I have also tried to run it using v0.05 and it still does not work.

Thank you for your time.

— Reply to this email directly, view it on GitHub https://github.com/BayraktarLab/cell2location/issues/137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMFTV2652IGZQOSW66PGPDVCL33VANCNFSM5R6JRMHQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

CeliaLerma commented 2 years ago

Thanks for the quick reply! I will try with the conda enviroment instead

CeliaLerma commented 2 years ago

Hi, As you suggested last time, I am not using the singularity image anymore and I have created a new environment to work with but I am encountering some problems still.

I created an environment this morning and installed:

conda create -n cell2loc python=3.9 -y
conda activate cell2loc
pip install git+https://github.com/BayraktarLab/cell2location

But this error pops up:

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
ERROR (theano.gpuarray): pygpu was configured but could not be imported or is too old (version 0.7 or higher required)
NoneType: None
Global seed set to 0
loaded inf_aver
read and modif visium slide
calculated QC metrics
Traceback (most recent call last):
 File "/gpfs/bwfor/home/hd/hd_hd/hd_td263/Visium_pipeline/scripts_cell2loc/cell2loc_mapping.py", line 72, in <module>
   scvi.data.setup_anndata(adata=adata, batch_key="sample")
AttributeError: module 'scvi.data' has no attribute 'setup_anndata'

I have also tried with pip install git+https://github.com/BayraktarLab/cell2location.git#egg=cell2location[tutorials] and the same error appears. Is there anything else that I should take into account when creating the environment that is missing?

Thank you for your time

vitkl commented 2 years ago

Hi again

can you try this solution?

https://github.com/BayraktarLab/cell2location/issues/142#issuecomment-1100842578

CeliaLerma commented 2 years ago

Hi, Thanks for the response. I have used the export PYTHONNOUSERSITE="someletters" and also got the jax error. After installing the corrected jax versions I still get the same error.

WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
ERROR (theano.gpuarray): pygpu was configured but could not be imported or is too old (version 0.7 or higher r$
NoneType: None
Global seed set to 0
loaded inf_aver
read and modif visium slide
calculated QC metrics
Traceback (most recent call last):
  File "/gpfs/bwfor/home/hd/hd_hd/hd_td263/Visium_pipeline/scripts_cell2loc/cell2loc_mapping.py", line 72, in $
    scvi.data.setup_anndata(adata=adata, batch_key="sample")
AttributeError: module 'scvi.data' has no attribute 'setup_anndata'

These are my package versions:

scvi-tools 0.16.0
cell2location 0.8a0

Are these the correct ones?

Thanks!