2017-07-20 8 views
0

Ich versuche import pandas as pd. Ich bekomme ModuleNotFoundError: No module named 'pandas.rpy'. Warum? Ich benutze Pandas 0.20.1 + Python 3.6 x64 + Windows 7.ModuleNotFoundError: Kein Modul namens 'pandas.rpy'

Beispiel:

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 

Returns:

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' 

Antwort

3

pandas.rpy Modul veraltet und später entfernt. Es existiert nicht die Version, die Sie gerade verwenden.

Sie können entweder Ihre Pandas Version herunterstufen, oder noch besser, werfen Sie einen Blick auf das neue padnas.rpy2 Modul.

Von Pandas Dokumentation:

Up to pandas 0.19, a pandas.rpy module existed with functionality to convert between pandas and rpy2 objects. This functionality now lives in the rpy2 project itself. See the updating section of the previous documentation for a guide to port your code from the removed pandas.rpy to rpy2 functions.

Sie können sehen, die rpy2 Dokumentation here.

Verwandte Themen