安裝的R包需要使用python搭建的包途蒋,報錯如下:
/> scAI_outs <- identifyClusters(scAI_outs, resolution = 1)
Error in runLeiden(SNN = snn, resolution = resolution, partition_type = partition.type, :
Cannot find Leiden algorithm, please install through pip (e.g. pip install leidenalg).
因此想用reticulate包在R中調(diào)用python去安裝,結(jié)果找不到conda.exe窜护?助赞?明明電腦里有的
網(wǎng)上一搜也全都是成功使用reticulate的例子买羞,沒什么失敗的。雹食。
/> py_available()
[1] FALSE
/> repl_python()
Error: Specified conda binary 'C:/PROGRA~3 /ANACON~1/Scripts/conda.exe' does not exist.
我一開始以為是自己電腦conda沒裝好畜普,然后試了試用來裝軟件是正常的,安裝的jupyter notebook都跑的好好的
就在要放棄的時候群叶,想了想自己都是百度找的吃挑,經(jīng)驗可能不全,去google了一下街立,能搜到很多類似的問題舶衬,參考了https://github.com/rstudio/keras/issues/256
/>Sys.setenv(RETICULATE_PYTHON="C:\\ProgramData\\Miniconda3\\python.exe")
指定路徑后再測試一下,果然好了呢赎离!
/>repl_python()
Python 3.7.3 (C:/ProgramData/Miniconda3/python.exe)
Reticulate 1.16 REPL -- A Python interpreter in R.
/> py_available()
[1] TRUE
開心逛犹!