我尝试通过rpy2(rpy2> = 3.0)在python中导入一些R库。但是我得到下面的错误。使用python 2和rpy2 == 2.80可以正常工作。以及使用python 3和rpy2 == 2.9.1。
Traceback (most recent call last):
File "testMultipipsa.py", line 70, in <module>
pr.runClusterPipsa(ingrp+outgrp,points=[],cluster=cl0)
File "multipipsa-4.0.2/multipipsa/multipipsa.py", line 625, in runClusterPipsa
self.runPipsa(structures, points=points)
File "multipipsa-4.0.2/multipipsa/multipipsa.py", line 674, in runPipsa
pipsaLog="sims"+filesuffix+".log")
File "multipipsa-4.0.2/multipipsa/clusterpipsa.py", line 113, in clusterSingleRun
base = rpackages.importr('base')
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/robjects/packages.py", line 492, in importr
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/robjects/packages.py", line 204, in __init__
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/robjects/packages.py", line 330, in __fill_rpy2r__
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/robjects/packages.py", line 264, in __fill_rpy2r__
File "functools.py", line 827, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/robjects/pandas2ri.py", line 177, in rpy2py_floatvector
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/rinterface_lib/conversion.py", line 28, in _
File "site-packages/rpy2-3.0.0-py3.7.egg/rpy2/rinterface_lib/sexp.py", line 148, in do_slot
LookupError: tzone
答案 0 :(得分:0)
这是rpy2
的最新更新中引入的错误,并在this thread中进行了报告。您可以在此处找到评论和解决方法建议,直到今天仍在进行中。
或者,一种快速解决方案是恢复到较旧的版本,例如,使用pip
,您可以输入:
pip install rpy2==2.9.5