2014-01-28 33 views
0

我使用pyrserve從python調用R腳本文件。我正在跑步。在在R腳本任意點,pyrserve給出了一個錯誤並退出:使用PyRserve完成數據錯誤

Traceback (most recent call last): 
    File "scriptV2.py", line 272, in <module> 
    rConn.eval("source(file.PropensityFlow)") 
    File "/Users/dipayanmaiti/Py3.3venv/lib/python3.3/site-packages/pyRserve/rconn.py", line 47, in decoCheckIfClosed 
    return func(self, *args, **kw) 
    File "/Users/dipayanmaiti/Py3.3venv/lib/python3.3/site-packages/pyRserve/rconn.py", line 119, in eval 
    return rparse(src, atomicArray=atomicArray) 
    File "/Users/dipayanmaiti/Py3.3venv/lib/python3.3/site-packages/pyRserve/rparser.py", line 539, in rparse 
    return rparser.parse() 
    File "/Users/dipayanmaiti/Py3.3venv/lib/python3.3/site-packages/pyRserve/rparser.py", line 349, in parse 
    self.lexer.readHeader() 
    File "/Users/dipayanmaiti/Py3.3venv/lib/python3.3/site-packages/pyRserve/rparser.py", line 94, in readHeader 
    self.responseCode = struct.unpack(b'<i', self.read(3) + b'\x00')[0] 
    File "/Users/dipayanmaiti/Py3.3venv/lib/python3.3/site-packages/pyRserve/rparser.py", line 149, in read 
    raise EndOfDataError() 
pyRserve.rparser.EndOfDataError 

我已經設置rserv.conf以下幾點:

maxinbuf 20000000 
maxsendbuf 0 

是否有人知道爲什麼會這樣?這看起來像一些緩衝區問題,因爲R腳本本身運行。

回答

0

這是一個遲到的答案,但在這種情況下,在調試模式下運行Rserve非常有用,因此可以在單獨的shell中監視其輸出。

R CMD Rserve.dbg 

在我見過Rserve打印警告控制檯極少數情況下,當發生這種情況發送直通pyRserve沒有返回從Rserve任何值的命令 - 這導致了上述「EndOfDataError」。