0

I am trying to use the new monocle3 program in R (version 3.6) and trying to use a cluster_cells function which utilizes Louvain community detection. When I try to run the below code it does not seem to work.

I am pretty sure I have installed Louvain properly on my Mac using anaconda in my terminal.

cds <- cluster_cells(cds, resolution=c(10^seq(-6,-1))) Error in value[3L] : Could not find louvain Python package. Please pass the python home directory where louvain is installed with python_home argument.

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
Brent
  • 1

1 Answers1

1

I met the same problem and solved by conda_install.

First, make sure py_configshows the path to your r-reticulate environment

> py_config()
python:         /anaconda3/envs/r-reticulate/bin/python
libpython:      /anaconda3/envs/r-reticulate/lib/libpython3.7m.dylib
pythonhome:     /anaconda3/envs/r-reticulate:/anaconda3/envs/r-reticulate
version:        3.7.1 (default, Oct 23 2018, 14:07:42)  [Clang 4.0.1 (tags/RELEASE_401/final)]
numpy:          /anaconda3/envs/r-reticulate/lib/python3.7/site-packages/numpy
numpy_version:  1.16.4
umap:           /anaconda3/envs/r-reticulate/lib/python3.7/site-packages/umap

python versions found: 
 /anaconda3/envs/r-reticulate/bin/python
 /usr/bin/python
 /usr/local/bin/python
 /usr/local/bin/python3

Then, install louvain in R by conda_install

conda_install(envname = "r-reticulate", packages="louvain")
Qian Zhang
  • 11
  • 2