网状1.13-使用R时出现“ sys $ stdout $ flush()中的错误:尝试应用非功能”(R-studio的作品)

时间:2019-08-05 10:45:47

标签: r python-3.x rstudio reticulate

网状(v1.13)在使用R(3.5)时每行返回错误

但是,当使用R-Studio运行相同的代码(和相同的模块)时,它可以正常工作而不会出现错误。 可能要检查/比较的设置/配置是什么?

需要使脚本每天自动运行几次。我确实使用R-studio开发了一个可行的解决方案。然后尝试从命令行R.exe .....运行相同的脚本->产生错误。 (OS WIN Server 2016标准)

非工作-使用RGui(64位)

> library(reticulate)
Warning message:
package ‘reticulate’ was built under R version 3.5.3 
> py_run_string("import zlib, sys, struct, numpy")
Error in sys$stdout$flush() : attempt to apply non-function
> py_run_string("i = 5")
Error in sys$stdout$flush() : attempt to apply non-function
> py$i
[1] 5

同一台机器-使用R-Studio进行工作

> library(reticulate)
Warning messages:
package ‘reticulate’ was built under R version 3.5.3 
> py_run_string("import zlib, sys, struct, numpy")
> py_run_string("i = 5")
> py$i
[1] 5

尝试使用

查找差异
py_discover_config() no luck they are the same.
(python) sys.getdefaultencoding no luck they are the same.
(R) Sys.getlocale() no luck they are the same.

即使代码似乎也可以执行-如何清除这些代码: “ sys $ stdout $ flush()中的错误:尝试应用非功能”

0 个答案:

没有答案