问题描述
我试图在R脚本的Reticulate中不使用R Markdown的情况下调用Python脚本。我需要由第三方应用程序(使用SYstem帐户)调用R脚本,然后再调用Python脚本。基本上我想在Python中使用R变量。当我在Windows中执行登录时,它运行正常,但在Windows中由SYstem帐户执行时,效果却不佳。我在“ C:\ Program Files \ python38 \ python.exe”下安装了Python。
R代码:
Sys.setenv(RETIculaTE_PYTHON = "C:\\Program Files\\python38\\python.exe")
library(reticulate)
use_python("C:\\Program Files\\python38\\python.exe",required = T)
message <- paste("Text from R",format(Sys.Date(),"%c"),sep = " ")
py_run_file("test_script.py")
Python代码:
import logging
logging.basicConfig(filename="test_script.log",level=logging.DEBUG,format='%(levelname)s: %(asctime)s %(message)s',datefmt='%m/%d/%Y %I:%M:%s')
logging.debug(r.message)
DEBUG: 10/30/2020 08:02:10 Text from R sex out 30 00:00:00 2020
DEBUG: 10/28/2020 02:28:37 <function make_python_function.<locals>.python_function at 0x00000243D21E3168>
Windows 10 R版本4.0.3 Python版本3.8.6 网状版本1.18
这是什么“ make_python_function”,以及如何使其在SYstem帐户下工作?感谢您提供任何信息!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)