2017-08-07 4 views
0

Ich habe pandas_datareader via pip und alles Erfolg installiert.pandas_datareader ImportError: Name kann nicht importiert werden string_types

Wenn ich versuche, einen einfachen Code auszuführen, ich habe unten Fehler: Python 2.7 Version adn Windows 7 64-Bit-System

"C:\Users\<username>\Anaconda2\python.exe" 
"C:/Users/<username>/PycharmProjects/untitled2/Yahoo.py" 

Traceback (most recent call last): 

    File "C:/Users/<username>/PycharmProjects/untitled2/Yahoo.py", line 1, in <module> 

import pandas_datareader as pdr 

    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas_datareader\__init__.py", line 3, in <module> 
    from .data import (get_components_yahoo, get_data_famafrench, get_data_google, get_data_yahoo, get_data_enigma, # noqa 

    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas_datareader\data.py", line 7, in <module> 

    from pandas_datareader.google.daily import GoogleDailyReader 
    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas_datareader\google\daily.py", line 1, in <module> 

    from pandas_datareader.base import _DailyBaseReader 

    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas_datareader\base.py", line 7, in <module> 

    import pandas.compat as compat 
    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas\__init__.py", line 25, in <module> 
    from pandas.core.api import * 

    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas\core\api.py", line 14, in <module> 

    from pandas.core.series import Series, TimeSeries 

    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas\core\series.py", line 35, in <module> 

    from pandas.compat.scipy import scoreatpercentile as _quantile 
    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas\compat\scipy.py", line 5, in <module> 

    import numpy as np 

    File "C:\Users\<username>\Anaconda2\lib\site-packages\pandas\compat\numpy\__init__.py", line 6, in <module> 

    from pandas.compat import string_types, string_and_binary_types 
ImportError: cannot import name string_types 

Process finished with exit code 1 

ich habe.

Ist der Prozess der Installation Problem?

+0

Pandas Version aktualisieren? –

+0

Ich denke, Datenreader ist nicht als Teil von Conda installiert (vorausgesetzt, Sie haben Pandas durch Anaconda, nach Datei-Links beurteilen). Sehen Sie diesen [Link] (http://www.phillipburger.net/wordpress/pandas-datareader-package-importerror/), der eine mögliche Lösung hat (nicht genau zu Ihrem einen, aber könnte helfen.) Sie könnten auch versuchen, Pip zu tun install --upgrade pandas – Clusks

+0

Es ist das Versionsproblem. Ich rüste das Conda auf und es funktioniert – Chelseajcole

Antwort

0

Ausgabe der Conda-Version. Müssen Sie die Conda Version

Verwandte Themen