r - reticulate 1.13 - 使用 R 时出现“sys$stdout$flush() 错误:尝试应用非功能”(R-studio 工作)
问题描述
reticulate (v1.13) 在使用 R (3.5) 时为每一行返回错误
但是,当使用 R-Studio 运行相同的代码(和相同的模块)时,它可以正常工作。要检查/比较的潜在设置/配置是什么?
需要每天自动运行几次脚本。我确实使用 R-studio 开发了一个可行的解决方案。然后尝试从命令行 R.exe 运行相同的脚本..... -> 产生的错误。(操作系统 WIN 服务器 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() 中的错误:尝试应用非函数”
解决方案
推荐阅读
- c# - EF Core 2.1 - 如何映射具有相同类型的多对多
- javascript - 使用回调中的变量作为全局变量
- sql - 使用 SCN 和表别名时获取无效的 SQL 语法
- ionic2 - 来自 CORS 预检通道的 CORS 标头“Access-Control-Allow-Headers”中缺少令牌“****”,带有流星 CLI 的 IONIC2
- python - 取 3 列并使用 stack() 转为 2 列
- android - Java 编译器错误,无法解析 R,构建失败
- css - 阻止模糊的标题图像略微透明
- hyperledger-fabric - 提交交易时出错
- java - 如何制作 SQL 语句
- mongodb - 在聚合管道中使用文档字段作为 JS 对象字段名