Teichlab / celltypist

A tool for semi-automatic cell type classification
https://www.celltypist.org/
MIT License
254 stars 40 forks source link

Issues running with conda #92

Closed edridgedsouza closed 8 months ago

edridgedsouza commented 8 months ago

Spent quite a while trying to debug this after I tried the web tool and got the error message "Error: 🛑 No such file: Healthy_Human_Liver.pkl"

conda create -n celltypist python=3.9
conda activate celltypist

mamba install celltypist -c bioconda -c conda-forge  # or, `pip install celltypist`

python
> import celltypist

If I install via conda, then open up python and import celltypist, I get an immediate error due to clashes with unrelated class types in imported libraries. Spent a while trying to hunt down a solution, which led to installing a downgraded version of matplotlib, which caused a different error. Even tried running from a Docker image on Dockerhub to no avail. Played whack-a-mole just trying to get the library to import, when I created a fresh env and installed using pip instead. This time it worked just fine!

I ran this on an aws r5.4xlarge ubuntu instance with only mamba and its dependencies installed in the base conda env. Not sure what the issue is, or if it's a problem specific to my machine, but figured I'd send a message in case the version on conda is somehow running differently than the one on pip.

prete commented 8 months ago

Hi @edridgedsouza Could you please paste here the full error you're getting?

Regarding the containerized version —Docker image— you can pull the official ones from Quay.io here: https://quay.io/repository/teichlab/celltypist?tab=tags I'm not sure which images from DockerHub you used, but the ones deescribed in the docs (on quay.io) should be work.

prete commented 8 months ago

Had a quick look and it seems like it's derived from an upstream package (scanpy) https://github.com/scverse/scanpy/issues/2411

EDIT @edridgedsouza forcing scanpy to the latest version should solve the issue: mamba install 'scanpy>1.9' celltypist -c bioconda -c conda-forge

edridgedsouza commented 8 months ago

Thanks, @prete! I actually pulled from https://hub.docker.com/r/prete/celltypist. It seems the issue you identified is what's behind it.