简体   繁体   English

无法使用网状在 Rmarkdown 中导入已安装的 python 模块

[英]Unable to import installed python modules in Rmarkdown with reticulate

I just installed the R package 'reticulate' and I found it especially useful.我刚刚安装了 R package 'reticulate',我发现它特别有用。 But with one con that I need to re-install python module (ie pandas) I have already installed.但是有一个缺点,我需要重新安装我已经安装的 python 模块(即熊猫)。 The python engine is miniconda and the evnv is by default. python 引擎是 miniconda,默认情况下是 evnv。 How can I specify the python interpreter so that I dont need to re-install all the installed module?如何指定 python 解释器,这样我就不需要重新安装所有已安装的模块? (After some search, I guess it has sth to do with 'virtualenv-tools ' in reticulate?) By the way, I used to execute python with pycharm and the interpreter is system interpreter located in c://python//python.exe (After some search, I guess it has sth to do with 'virtualenv-tools ' in reticulate?) By the way, I used to execute python with pycharm and the interpreter is system interpreter located in c://python//python.可执行程序

Any idea?任何想法?

Have you looked at this page , you have to specify which Python engine you want, in this case miniconda, but just have to tell Rmarkdown where that is located on your computer using the use_python function.你看过 这个页面吗,你必须指定你想要的 Python 引擎,在这种情况下是 miniconda,但只需要使用use_python function 告诉 Rmarkdown 它在你的计算机上的位置。

```{r setup, include=FALSE}
library(reticulate)
use_python('/location/to/engine')
```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM