Use reticulate in RStudio with normal Python installation

Hello!
I'm a biologist using R for single cell RNA sequencing data analysis. Currently I'm trying to follow the Seurat team's tutorial which later uses UMAP (Python package umap-learn), integrated into R using reticulate, for dimensionality reduction. My setup is the following:

  • Windows 10 1903 64-bit
  • R 3.6.1 64-bit
  • RStudio 1.2.1335
  • Seurat 3.0.2
  • Python 3.7.4 64-bit

However I simply cannot seem to get it to work. First py_install complained about missing Anaconda:

> py_install("umap_learn")
Error: Conda installation not found (failed to locate conda binary)
Please install Anaconda for Windows (https://www.anaconda.com/download/#windows) before proceeding

I installed Anaconda, set up a Conda environment and installed umap_learn, however reticulate wouldn't see the package. In their Github repo, the Seurat authors often state that Anaconda doesn't properly work with reticulate (even though the recitulate function suggests installing Anaconda, see above) and suggests to use the system-wide Python. Now I uninstalled Anaconda and reticulate finds that installation as well:

> py_config()
python:         C:\Users\Yassin\AppData\Local\Programs\Python\Python37\python.exe
libpython:      C:/Users/Yassin/AppData/Local/Programs/Python/Python37/python37.dll
pythonhome:     C:\Users\Yassin\AppData\Local\Programs\Python\Python37
version:        3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Architecture:   64bit
numpy:           [NOT FOUND]

python versions found: 
 C:\Users\Yassin\AppData\Local\Programs\Python\Python37\python.exe
 C:\Users\Yassin\AppData\Local\Programs\Python\Python37\\python.exe
 C:\Users\Yassin\AppData\Local\Programs\Python\PYTHON~1\\python.exe

However despite me installing umap_learn using pip, py_module_available indicates that umap-learn is not present and trying to install it using py_install makes it ask for Anaconda again.

So I'm stuck. Is it even possible to use reticulate with a normal Python installation on Windows?

Welcome @yassin!

I have been able to use reticulate with my (pre-installed) conda installation -- I often have to use the use_python or use_condaenv functions before anything works (I've started to insist on keeping the
required = TRUE argument in there, to see if I get an error.

Additionally, I have gotten into installing things directly into anaconda (without using the reticulate::py_install()function),and then opening R

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.