Python, R and rpy2 c-stack too close to the limit error message

自作多情 提交于 2019-12-24 19:02:41

问题


Edit: I have seen a few answers to this question for people working in UNIX based systems but I am working in windows so I don't think these will work.

I am trying to call R from Python via the rpy2 package, everything seemed to be working fine and then one day I started to get his error, just trying to import rpy2 packages. The code is simply:

from rpy2 import robjects as r
from rpy2.robjects.packages import importr
from rpy2.robjects.vectors import DataFrame
from rpy2.robjects import Formula 
from rpy2.robjects import pandas2ri

And the error message I get is:

Error: C stack usage 24382064 is too close to the limit

Things I've tried so far are:

  • Running the file with a random, non rpy2 related import statement, the error does not appear in this case
  • I tried to think of a way of turning c-stack checking off from within R (i.e. using R_CStackLimit = -1) but I think this needs to be done for every R session, and as I can't connect to R at all without getting the error I can't send any commands to R.

Would really appreciate some advice, I've been trying to work this out for days and got pretty much nowhere.

Tim

来源:https://stackoverflow.com/questions/47592822/python-r-and-rpy2-c-stack-too-close-to-the-limit-error-message

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!