chanzuckerberg / cellxgene

An interactive explorer for single-cell transcriptomics data
https://chanzuckerberg.github.io/cellxgene/
MIT License
626 stars 116 forks source link

[BUG] Can not start cellxgene #2615

Closed pati-ni closed 1 year ago

pati-ni commented 1 year ago

Describe the bug

I think the dependency tree is not quite right. the API complains about the numpy API version. I tried also downgrading numpy to 1.22 which did not fix the issue

cellxgene launch https://cellxgene-example-data.czi.technology/pbmc3k.h5ad
Traceback (most recent call last):
  File "__init__.pxd", line 942, in numpy.import_array
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/main/miniconda3/envs/cellxgene/bin/cellxgene", line 5, in <module>
    from server.cli.cli import cli
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/server/cli/cli.py", line 3, in <module>
    from .annotate import annotate
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/server/cli/annotate.py", line 12, in <module>
    import pandas as pd
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev  # pyright: ignore # noqa:F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/compat/__init__.py", line 18, in <module>
    from pandas.compat.numpy import (
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
    from pandas.util.version import Version
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/util/__init__.py", line 2, in <module>
    from pandas.util._decorators import (  # noqa:F401
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
  File "pandas/_libs/hashtable.pyx", line 1, in init pandas._libs.hashtable
  File "pandas/_libs/missing.pyx", line 1, in init pandas._libs.missing
  File "/home/main/miniconda3/envs/cellxgene/lib/python3.11/site-packages/pandas/_libs/tslibs/__init__.py", line 36, in <module>
    from pandas._libs.tslibs import dtypes
  File "pandas/_libs/tslibs/dtypes.pyx", line 1, in init pandas._libs.tslibs.dtypes
  File "pandas/_libs/tslibs/np_datetime.pyx", line 28, in init pandas._libs.tslibs.np_datetime
  File "__init__.pxd", line 944, in numpy.import_array
ImportError: numpy.core.multiarray failed to import

To Reproduce

cellxgene launch https://cellxgene-example-data.czi.technology/pbmc3k.h5ad

Expected behavior cellxgene startup

Version (please complete the following information):

MaximilianLombardo commented 1 year ago

Hey @pati-ni, thanks for the report! Could you try reproducing the error with one of the datasets downloaded from our data portal?

I was able to reproduce an error (albeit a different one than you encountered) with the PBMC3K object, but was able to get CELLxGENE to successfully launch when using a dataset (.h5ad) downloaded from the data portal - I'd like to check if the error you are encountering is a dataset issue rather than a CELLxGENE issue

Also, can you let us know what version of CELLxGENE you are running?

pati-ni commented 1 year ago

Hi MaximilianLombardo,

thank you for your quick reply. cellxgene is v1.1.2. Numpy is v1.22.

As you suggested, I downloaded the "scRNA-seq data - lymphatic cells" from the portal and I got exactly the same behaviour running it from passing the file locally.

I do not think the file is being opened in the first place because the error is almost instant whereas I would expect the launch to lag until the file is downloaded.

Is there a specific dependency that my environment is missing?

MaximilianLombardo commented 1 year ago

Ok thanks for the info - yea the versions of CELLxGENE and Numpy look ok - have you tried installing CELLxGENE in a fresh conda environment?

pati-ni commented 1 year ago

This was on a new fresh conda environment.

I actually just fixed it. The culprit, was a defunct pandas package. Not sure why.. Pandas work fine in different environments. I installed the latest version from conda and the app launched with no problems.

Thanks for the support

MaximilianLombardo commented 1 year ago

ahh understand, thanks for letting us know you've been able to resolve the issue!