我正在尝试修复与此pandas.rpy.common
相关的错误:
# activate python 2.7 env
$ source activate py27
# this says requirements satisfied
$ pip install rpy2
Requirement already satisfied: rpy2 in ./lib/python2.7/site-packages
Requirement already satisfied: singledispatch in ./lib/python2.7/site-packages/singledispatch-3.4.0.3-py2.7.egg (from rpy2)
Requirement already satisfied: six in ./lib/python2.7/site-packages (from rpy2)
# test if rpy2, pandas is installed
$ cat test.py
import rpy2 # ok
import pandas # ok
import pandas.rpy.common # this line throws an error
# run the script
$ python test.py
Traceback (most recent call last):
File "/home/rathik/test.py", line 3, in <module>
import pandas.rpy.common
ImportError: No module named rpy.common
我已阅读了一些相关问题,设置了我的R_HOME
和R_USER
,但没有任何效果:
$ echo $R_HOME
/home/rathik/tools/miniconda3/envs/py27/bin/R
$ echo $R_USER
/home/rathik/tools/miniconda3/envs/py27/lib/python2.7/site-packages/rpy2
非常感谢任何帮助。
谢谢!