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

nflgame doesn't have any data upon install...? #347

Open
eldanothemano opened this issue Nov 18, 2017 · 4 comments
Open

nflgame doesn't have any data upon install...? #347

eldanothemano opened this issue Nov 18, 2017 · 4 comments

Comments

@eldanothemano
Copy link

Hi there! Just found this code and I'm really excited to get it up and running. I created a virtual environment using python 2.7 within pycharm. I used tutorials from this link:

https://www.jetbrains.com/help/pycharm-edu/installing-uninstalling-and-upgrading-packages.html

to find nflgame and install its package into the environment. I then copied and pasted this code from the nflgame wiki site and ran it:

import nflgame

games = nflgame.games(2017, week=9)
players = nflgame.combine_game_stats(games)
for p in players.rushing().sort('rushing_yds').limit(5):
msg = '%s %d carries for %d yards and %d TDs'
print msg % (p, p.rushing_att, p.rushing_yds, p.rushing_tds)

I then got the following error thrown:

/home/dan/NFLGame_virt_env/bin/python /home/dan/IDEs/pycharm-2017.2.4/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 35684 --file /home/dan/PycharmProjects/NFL_Stats_Importer/generate_deep_NFL_stats.py
pydev debugger: process 16429 is connecting

Connected to pydev debugger (build 172.4343.24)
Traceback (most recent call last):
File "/home/dan/IDEs/pycharm-2017.2.4/helpers/pydev/pydevd.py", line 1599, in
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/dan/IDEs/pycharm-2017.2.4/helpers/pydev/pydevd.py", line 1026, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/dan/PycharmProjects/NFL_Stats_Importer/generate_deep_NFL_stats.py", line 3, in
games = nflgame.games(2017, week=9)
File "/home/dan/NFLGame_virt_env/local/lib/python2.7/site-packages/nflgame/init.py", line 229, in games
return list(games_gen(year, week, home, away, kind, started))
TypeError: 'NoneType' object is not iterable

Process finished with exit code 1

So all the functions are there and it appears to be installed properly...am I supposed to perform an additional step that I missed? Thanks for any help that can be provided!

dan

@eldanothemano
Copy link
Author

So digging through the directory tree, it appears the gamecenter-json file is still compressed as a gz file. I am attempting to find that director through the terminall so I can unzip everything there. Hopefully somebody will post and give me the answer :)

If I get it working, I'll make sure to post the solution

@eldanothemano
Copy link
Author

OK, well I unzipped all those files...didn't fix anything. Ugh

@eldanothemano
Copy link
Author

OMG, I feel so stupid. I changed the year to 2016 and it output all the data. I'm guessing I have to run some more code to update the json file so that it includes game data from 2017.

@ariannedee
Copy link

You need to run python update_sched.py --year 2017 to update the json file. There are a few other issues you might run into though, so read through #331.

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

2 participants