Closed carloelle closed 3 years ago
Unfortunately there are not yet binary wheels available for Python 3.9 from PyPI, but there are binaries available for Python 3.8. Could you perhaps try to use Python 3.8 instead (at least for the time being)?
You could try to install using the --no-use-pep517
option? You will need to install also build dependencies though (see https://igraph.org/python/#pycompile for details).
So, --no-use-pep517
using Python3.9 (and also python2.7, the reason I updated to the last version of python) resulted in the same error.
Though installing python3.8 fixed this issue and Leidenalg 0.8.2. is successfully installed.
Still, in R using Seurat, if I run FindClusters(x, resolution = 1e-4, algorithm=4
(4 corresponds to Leiden alg.)
it returns the error
Cannot find Leiden algorithm, please install through pip (e.g. pip install leidenalg).
since I have multiple versions of python installed, do you know if Seurat 3.2.2 is referring to a particular python version in which it's looking for leidenalg?
Sorry, I don't know how to solve the Seurat dependency immediately. Probably @TomKellyGenetics could be of help here.
Resolved: use the reticulate package to define which python version to use (at the beginning of the r session). for more info: https://rstudio.github.io/reticulate/reference/use_python.html
To clarify, calling leidenalg with the 'leiden' R package or in 'Seurat' just requires any version of leidenalg to be installed in Python. In principle, it should be able to run if any Python version is installed. My current working uses Python 3.7.3 but as long as the arguments passes haven't been changed in leidenalg it should work (definitely no need to use Python 2 but it should be supported). Note that Seurat (optionall) runs other functions (e.g., UMAP) through Python with reticulate also have the should be supported by the same Python version.
I recommend using a conda environment with "reticulate" but a pip install should be possible, provided you direct R to the same version of python.
Hello, followed by carloelle , I've solved this issue, Here are some detailed scripts:
First, module load anaconda3 Then create your virtual environment: your_env After activating the environment: source activate your_env: pip install leidenalg
Then deactivate the environment
Then in your R script:
dt.seurat <- FindNeighbors(dt.seurat, dims = 1:20, verbose = 0) use_condaenv(condaenv = "your_env", required = TRUE) py_run_string('import leidenalg') dt.seurat <- FindClusters(dt.seurat, resolution = 0.1, algorithm=4, method="igraph") dt.seurat <- RunUMAP(dt.seurat,dims = 1:20, metric="correlation")
Hi, similarly to other users, I cannot install leidenalg version 0.8.2 due to an error for PEP 517. From my terminal:
Note that I am able to install leidenalg version 0.7.0. (but when I ran it through Seurat in R, it cannot find leiden algorithm:
FindClusters(PDAC.subset, resolution = 1e-4,algorithm=4, method="igraph")
Error: Cannot find Leiden algorithm, please install through pip (e.g. pip install leidenalg).
igraph is already installed (igraph 0.8.3 running inside Python 3.9.0).
since PEP 517 errors are a common issue (see https://github.com/pydata/bottleneck/issues/281 ), I tried to install anaconda and install leidenalg through anaconda, but still in R Seurat does not recognize it, returning the same error (Cannot find Leiden algorithm). I also tried to install Visual Studio as someone suggested (since it should update all the wheels), but it doesn't work again.
Any idea how to proceed?