Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError in CellPhoneDB - Cannot Import main #207

Open
ArzooShamoon opened this issue Nov 18, 2024 · 1 comment
Open

ImportError in CellPhoneDB - Cannot Import main #207

ArzooShamoon opened this issue Nov 18, 2024 · 1 comment

Comments

@ArzooShamoon
Copy link

ArzooShamoon commented Nov 18, 2024

I'm encountering an ImportError when trying to run CellPhoneDB commands in my conda environment. The error message indicates that cellphonedb cannot import the main module from the package.

I have tried

conda create -n cpdb_env python=3.8
conda activate cpdb_env
pip install cellphonedb
(cpdb_env) ashamoon@c37:/projects/mpn/Arzoo/Fleischhauer_lab/Integrated_ScRNA_analysis/Sample1234/CellPhoneDB$ cellphonedb method analysis test_meta.txt test_counts.txt 
Traceback (most recent call last):
  File "/homes/ashamoon/mambaforge/envs/renv/bin/cellphonedb", line 2, in <module>
    from cellphonedb import main
ImportError: cannot import name 'main' from 'cellphonedb' (/homes/ashamoon/mambaforge/envs/renv/envs/cpdb_env/lib/python3.8/site-packages/cellphonedb/__init__.py
(cpdb_env) ashamoon@c37:/projects/mpn/Arzoo/Fleischhauer_lab/Integrated_ScRNA_analysis/Sample1234/CellPhoneDB$ cellphonedb --help
Traceback (most recent call last):
  File "/homes/ashamoon/mambaforge/envs/renv/bin/cellphonedb", line 2, in <module>
    from cellphonedb import main
ImportError: cannot import name 'main' from 'cellphonedb' (/homes/ashamoon/mambaforge/envs/renv/envs/cpdb_env/lib/python3.8/site-packages/cellphonedb/__init__.py)
@cakirb
Copy link
Collaborator

cakirb commented Nov 22, 2024

Hi @ArzooShamoon,

Thanks for using CellPhoneDB! Seems like you're using CLI commands, but they are discontinued after v5 (not sure how they are both recognised and cannot be found) so you should use CellPhoneDB from Python instead of running CellPhoneDB commands from terminal.

Hope this helps!

Best,
Batu

@cakirb cakirb changed the title Issue Title: ImportError in CellPhoneDB - Cannot Import main ImportError in CellPhoneDB - Cannot Import main Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants