vtraag / leidenalg

Implementation of the Leiden algorithm for various quality functions to be used with igraph in Python.
GNU General Public License v3.0
596 stars 78 forks source link

ImportError #83

Closed Sa753 closed 2 years ago

Sa753 commented 3 years ago

Dear team

I am using leidenalg as part of infercnv package and I am consistently getting an error that

Error in py_module_import(module, convert = convert) :
ImportError: No module named leidenalg

I definitely have it installed and I can import it.

I am running python 3.7 and used pip install leidenalg to install it igraph and python-igraph are also installed as shown below

(base) CHS-INF-053:~ elo01$ pip install leidenalg
Collecting leidenalg
  Using cached leidenalg-0.8.7-cp37-cp37m-macosx_10_9_x86_64.whl (230 kB)
Requirement already satisfied: python-igraph>=0.9.0 in ./opt/anaconda3/lib/python3.7/site-packages/python_igraph-0.9.6-py3.7-macosx-10.9-x86_64.egg (from leidenalg) (0.9.6)
Requirement already satisfied: texttable>=1.6.2 in ./opt/anaconda3/lib/python3.7/site-packages/texttable-1.6.4-py3.7.egg (from python-igraph>=0.9.0->leidenalg) (1.6.4)
Installing collected packages: leidenalg
Successfully installed leidenalg-0.8.7
(base) CHS-INF-053:~ elo01$ python
Python 3.7.10 (default, Feb 26 2021, 10:16:00) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import leidenalg                               
>>> import igraph

I also have igraph and leiden on R

Could you please help? Thanks

Sa753 commented 2 years ago

Any suggestions please?

vtraag commented 2 years ago

Sorry for the long wait. I think that this is not a problem of leidenalg, but rather of infercnv. As you show, you have installed both leidenalg and python-igraph correctly, so there's little that can be done on this side.

If my understanding is correct, infercnv is an R package that relies on the Python package of leidenalg. I am not sure how it does this, but presumably they can help you better with this question than I can, feel free to open an issue in their repository: https://github.com/broadinstitute/infercnv

I'm closing this issue now. If there's anything still that does not work correctly from the leidenalg perspective, feel free to report back and re-open if necessary.