我试图import pandas as pd
。我得到ModuleNotFoundError: No module named 'pandas.rpy'
。为什么?我使用pandas 0.20.1 + python 3.6 x64 + Windows 7。
示例:
import os
os.environ['R_HOME'] = 'C:\Program Files\R\R-3.4.0'
os.environ['R_USER'] = 'bob'
import rpy2.robjects as robjects
import pandas.rpy.common as com
import pandas as pd
返回:
Traceback (most recent call last):
File "C:\doc\GitHub\proj\src\open_rdata.py", line 19, in <module>
import pandas.rpy.common as com
ModuleNotFoundError: No module named 'pandas.rpy'
答案 0 :(得分:7)