llSourcell / predicting_stock_prices

This is the coding challenge for "Predicting Stock Prices" by @Sirajology on Youtube
297 stars 196 forks source link

why did i fail ? #3

Open jinpengchina opened 7 years ago

jinpengchina commented 7 years ago
predicting_stock_prices git:(master) ✗ python demo.py
Traceback (most recent call last):
  File "demo.py", line 7, in <module>
    plt.switch_backend('newbackend')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.py", line 122, in switch_backend
    matplotlib.use(newbackend, warn=False, force=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py", line 1149, in use
    name = validate_backend(arg)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/rcsetup.py", line 146, in validate_backend
    return _validate_standard_backends(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/rcsetup.py", line 57, in __call__
    % (self.key, s, self.valid.values()))
ValueError: Unrecognized backend string "newbackend": valid strings are ['pdf', 'pgf', 'Qt4Agg', 'GTK', 'GTKAgg', 'ps', 'agg', 'cairo', 'MacOSX', 'GTKCairo', 'WXAgg', 'template', 'TkAgg', 'GTK3Cairo', 'GTK3Agg', 'svg', 'WebAgg', 'CocoaAgg', 'emf', 'gdk', 'WX']
jinpengchina commented 7 years ago

plt.switch_backend('newbackend') -----------------err ???

jamesalexanderdickerson commented 7 years ago

If you look at the error, 'ValueError: Unrecognized back end string "newbackend"' It tells you. Valid strings are 'pdf', 'pgf', 'Qt4Agg', etc. "newbackend" is not a valid argument.

satroan commented 7 years ago

I tried putting all the values in the table for running it on an Ubuntu distro.... it just freeezes at terminal no output anyone has working code for this?

tobiasfricke commented 7 years ago

have you tried a smaller CSV file, i. e. less training data? If there are no "errors" - maybe you're just not waiting for it to finish? (happened to me)

psychomonkey911 commented 7 years ago

is the same error

Traceback (most recent call last):
  File "demo.py", line 7, in <module>
    plt.switch_backend('newbackend')  
  File "/home/sky/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.py", line 230, in switch_backend
    matplotlib.use(newbackend, warn=False, force=True)
  File "/home/sky/anaconda2/lib/python2.7/site-packages/matplotlib/__init__.py", line 1351, in use
    name = validate_backend(arg)
  File "/home/sky/anaconda2/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 232, in validate_backend
    return _validate_standard_backends(s)
  File "/home/sky/anaconda2/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 70, in __call__
    % (self.key, s, list(six.itervalues(self.valid))))
ValueError: Unrecognized backend string "newbackend": valid strings are [u'pgf', u'cairo', u'MacOSX', u'CocoaAgg', u'gdk', u'ps', u'GTKAgg', u'nbAgg', u'GTK', u'Qt5Agg', u'template', u'emf', u'GTK3Cairo', u'GTK3Agg', u'WX', u'Qt4Agg', u'TkAgg', u'agg', u'svg', u'GTKCairo', u'WXAgg', u'WebAgg', u'pdf']
sejas commented 7 years ago

If you have mac os, then In demo.py write plt.switch_backend('macosx') instead of plt.switch_backend('newbackend')

Or you can try these options:

GTKAgg
GTK3Agg
GTKAggGTKCairo
GTK3Cairo
WXAgg
WX
TkAgg
Qt4Agg
Qt5Agg
macosx

If none of them works, just try to install someone http://matplotlib.org/faq/usage_faq.html#what-is-a-backend

sejas commented 7 years ago

Here you can check the modifications I've made to solve it : https://github.com/machinelearning-spain/predicting_stock_prices/commit/c47785fcb168290d7c34c495731eb7c325170b63

bitcoinbrisbane commented 7 years ago

Im getting the same on a Ubuntu VM on MacOS

sramakrishnan247 commented 7 years ago

It just freezes in ubuntu..any idea how to make it work?

sejas commented 7 years ago

Guys, if you have issues with MAC OS, try to use this repo I modified https://github.com/machinelearning-spain/predicting_stock_prices

rtakapu commented 7 years ago

If your data set is large and if you are using a PC, it may take awhile for your PC to present the data. Just give it some time to do its gucciness and the data will show (mine took 20 mins). Also, make sure your backend represents the appropriate argument needed to function.

pucca601 commented 6 years ago

less data: about 5~10 items works for me