pandas-datareade和AttributeError:NoneType对象没有属性'fileno'

时间:2017-10-26 19:45:53

标签: python-3.x pandas pandas-datareader

我尝试了以下代码:

import pandas_datareader.data as web import datetime   
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2017, 10, 26)
f = web.DataReader("F", 'yahoo', start, end)

并收到以下错误:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    f.Close
  File "C:\Python34\lib\idlelib\rpc.py", line 611, in displayhook
    text = repr(value)
  File "C:\Python34\lib\site-packages\pandas\core\base.py", line 72, in __repr__
    return str(self)
  File "C:\Python34\lib\site-packages\pandas\core\base.py", line 51, in __str__
    return self.__unicode__()
  File "C:\Python34\lib\site-packages\pandas\core\series.py", line 982, in __unicode__
    width, height = get_terminal_size()
  File "C:\Python34\lib\site-packages\pandas\io\formats\terminal.py", line 33, in get_terminal_size
    return shutil.get_terminal_size()
  File "C:\Python34\lib\shutil.py", line 1071, in get_terminal_size
    size = os.get_terminal_size(sys.__stdout__.fileno())
AttributeError: 'NoneType' object has no attribute 'fileno'

当错误发生时,我使用Python 3.4 [错误: 3.5 ]和pandas 0.2。 Python 3.6上的相同代码与pandas 0.2在另一个工作站上运行没有问题。任何人都知道如何解决这个错误。

我已经尝试卸载并重新安装pandas和pandas-datareader,但它没有帮助。

0 个答案:

没有答案