【发布时间】:2020-09-07 23:51:13
【问题描述】:
与此处的错误基本相同,但这些解决方案没有提供足够的信息来复制工作示例:Rpy2 in a Flask App: Fatal error: unable to initialize the JIT
在我的 Flask 应用程序中,使用 rpy2.rinterface 模块,每当我初始化 R 时,我都会收到相同的堆栈使用错误:
import rpy2.rinterface as rinterface
from rpy2.rinterface_lib import openrlib
with openrlib.rlock:
rinterface.initr()
Error: C stack usage 664510795892 is too close to the limit Fatal error: unable to initialize the JIT
rinterface 是 rpy2 中的低级 R 钩子,但更高级别的 robjects 模块给出了相同的错误。我尝试将上下文锁和 R 初始化包装在来自多处理模块的 Process 中,但有同样的问题。文档说多线程环境会给 R 带来问题:https://rpy2.github.io/doc/v3.3.x/html/rinterface.html#multithreading 但是上下文管理器似乎并没有阻止与 R
接口的问题【问题讨论】:
标签: r multithreading flask rpy2