Maxim
I am getting the same type of error running anything that tries to pick up a Yahoo feed.
Traceback (most recent call last):
File "btfd.py", line 233, in <module>
runstrat()
File "btfd.py", line 177, in runstrat
cerebro.run(**eval('dict(' + args.cerebro + ')'))
File "/Users/rorymackay/anaconda/envs/backtrader/lib/python2.7/site-packages/backtrader/cerebro.py", line 1070, in run
runstrat = self.runstrategies(iterstrat)
File "/Users/rorymackay/anaconda/envs/backtrader/lib/python2.7/site-packages/backtrader/cerebro.py", line 1146, in runstrategies
data.preload()
File "/Users/rorymackay/anaconda/envs/backtrader/lib/python2.7/site-packages/backtrader/feed.py", line 689, in preload
self.f.close()
AttributeError: 'NoneType' object has no attribute 'close'
I assume it is for the same reason, earlier I had an error message that pointed directly to the url you showed.
However using pandas and accessing the same data (perhaps not in the same way ) I do get a response.
I did have to directly install the pandas-Datareader from pip as the anaconda one was not working. (this on a linux box)
Conda appears to have fixed this as the "latest" version is working on a mac...
pandas-datareader 0.3.0.post0 py27_0 conda-forge
This is the pip version that is now working on the linux box.
Not sure if that sheds any light on the issue.
this gets the data to a csv ...
import datetime
import numpy as np
import pandas as pd
#import pandas_datareader as pdr
import pandas_datareader.data as web
import os
import sys # To find out the script name (in argv[0])
start = datetime.datetime(2000, 1, 1)
end = datetime.datetime(2015, 5, 9)
data = web.DataReader('ORCL', 'google',start,end)
os.chdir('/Users/rorymackay/Documents/backtrader_test')
modpath = os.path.dirname(os.path.abspath(sys.argv[0]))
datapath = os.path.join(modpath,'backtrader_test/datas/orcl.csv')
data.to_csv('orcl.csv')