Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error from import cell2location

See original GitHub issue

Hi, I was just wondering whether anyone could interpret this error or give me any tips how to fix it? I’ve installed cell2location in a conda environment as per the instructions to do so manually but am getting this error upon trying to import it:

In [1]: import sys
   ...: import scanpy as sc
   ...: import anndata
   ...: import pandas as pd
   ...: import numpy as np
   ...: import os
   ...: data_type = 'float32'
   ...: import cell2location

LoweringError: Failed in nopython mode pipeline (step: nopython mode backend)
Storing i64 to ptr of i32 ('dim'). FE type int32

File "../../../.local/lib/python3.7/site-packages/umap/", line 52:
def rdist(x, y):
    <source elided>
    result = 0.0
    dim = x.shape[0]

During: lowering "dim = static_getitem(value=$8load_attr.2, index=0, index_var=$const10.3, fn=<built-in function getitem>)" at /home/camerongw/.local/lib/python3.7/site-packages/umap/ (52)

I’m using python-3.7.10.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

yozhikoffcommented, Mar 22, 2021

Hi camerongw!

I can’t reproduce this error, but it’s definitely something related to the numba package. Are you using the 0.53.0 version? Could you please try the following?

conda update numba

vitklcommented, Apr 20, 2021

I would strongly recommend using a separate conda environment for cell2location and other tools you are using.

If you are already doing that your error suggests that python uses umap from .local/lib/python3.7/site-packages/umap rather than conda environment. This is a common error in some HPC and can be solved by disabling the pip user site by adding this line to your .bashrc:

export PYTHONNOUSERSITE="canbeanyletters"

You also need to make sure that you active the conda environment, and that your $PATH environmental variable contains path to the conda environment before the path to any other python installation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common errors — cell2location documentation - Read the Docs
If you see these error when importing cell2location it means that you have incorrectly installed theano and it's dependencies (fix depends on the...
Read more >
Google colab tutorial gives error on 'import cell2location' · Issue #42 ...
The colab tutorial given on the cell2location documentation page gives an error when trying to import cell2location at cell 3, line 15.
Read more >
cell2location - PyPI
If you see these error when importing cell2location it means that you have incorrectly installed theano and it's dependencies (fix depends ...
Read more >
The 'pynndescent' distribution was not found and is required ...
I was trying to run this tutorial and it gives the following error on 'import cell2location' (cell 3, line 15),.
Read more >
cell2location - Wellcome Sanger Institute
Cell2location maps the spatial distribution of cell types by integrating single-cell RNA-seq ... variation by employing a flexible count-based error model.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found