Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "python data_fetcher.py" #30

Open
XingLiuJia opened this issue Jan 10, 2019 · 3 comments
Open

Error "python data_fetcher.py" #30

XingLiuJia opened this issue Jan 10, 2019 · 3 comments

Comments

@XingLiuJia
Copy link

/media/scw4750/个人文件/donghui/stock-rnn-master/data_fetcher.py:38: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)
Loaded 505 stock symbols
df_sp500.sort('Market Cap', ascending=False, inplace=True)
Fetching AAPL ...
https://finance.google.com/finance/historical?output=csv&q=AAPL&startdate=Jan+1%2C+1980&enddate=Jan+10%2C+2019
Traceback (most recent call last):
File "/media/scw4750/个人文件/donghui/stock-rnn-master/data_fetcher.py", line 111, in
main()
File "/home/scw4750/anaconda2-caffe/lib/python2.7/site-packages/click/core.py", line 716, in call
return self.main(*args, **kwargs)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/media/scw4750/个人文件/donghui/stock-rnn-master/data_fetcher.py", line 103, in main
succeeded = fetch_prices(sym, out_name)
File "/media/scw4750/个人文件/donghui/stock-rnn-master/data_fetcher.py", line 65, in fetch_prices
f = urllib2.urlopen(symbol_url)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/urllib2.py", line 1241, in https_open
context=self._context)
File "/home/scw4750/anaconda2-caffe/lib/python2.7/urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 101] Network is unreachable>

Process finished with exit code 1

@kprojiang
Copy link

another fork repo, has the downloaded data already. https://github.com/jimenbian/stock-rnn

@snowhou
Copy link

snowhou commented Jan 18, 2019

another fork repo, has the downloaded data already. https://github.com/jimenbian/stock-rnn

when i run python main.py --stock_symbol=SP500 --train --input_size=1 --lstm_size=128 --max_epoch=50

Traceback (most recent call last):
File "main.py", line 9, in
from model_rnn import LstmRNN
File "/root/stock/model_rnn.py", line 135
print "len(merged_test_X) =", len(merged_test_X)
^
SyntaxError: invalid syntax

@kprojiang
Copy link

another fork repo, has the downloaded data already. https://github.com/jimenbian/stock-rnn

when i run python main.py --stock_symbol=SP500 --train --input_size=1 --lstm_size=128 --max_epoch=50

Traceback (most recent call last):
File "main.py", line 9, in
from model_rnn import LstmRNN
File "/root/stock/model_rnn.py", line 135
print "len(merged_test_X) =", len(merged_test_X)
^
SyntaxError: invalid syntax

Probably, you are using a Python 3 environment, while apparently this part of code is Python 2. Some minor adjustment is recommended. Won't take you much time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants