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 with Python 2.6 #89

Closed
anontemp123 opened this issue Aug 26, 2014 · 8 comments
Closed

nflgame with Python 2.6 #89

anontemp123 opened this issue Aug 26, 2014 · 8 comments

Comments

@anontemp123
Copy link

According to https://github.com/BurntSushi/nflgame :

"nflgame does not yet work on Python 3, but it should work with Python 2.6 and 2.7."

I get this error when importing:
File "/usr/local/lib/python2.6/dist-packages/nflgame/sched.py", line 34, in _create_schedule
if (datetime.datetime.utcnow() - last_updated).total_seconds() >= day:
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

Anyway to work around this without installing 2.7? I might not be able to upgrade on one of the machines I use.

Also, is there a proper way to remove nflgame? The pip command installed four packages for me. I'm unsure if I have to uninstall in a specific order or anything like that.

Installing collected packages: beautifulsoup4, nflgame, ordereddict, pytz
Running setup.py install for beautifulsoup4
Running setup.py install for nflgame
changing mode of build/scripts-2.6/nflgame-update-players from 644 to 755
changing mode of /usr/local/bin/nflgame-update-players to 755
Running setup.py install for ordereddict
Running setup.py install for pytz
Successfully installed beautifulsoup4 nflgame ordereddict pytz

@anontemp123
Copy link
Author

One more question: Will nflgame work if installed locally (under a user account) instead of globally (via root)?

@BurntSushi
Copy link
Owner

Python 2.6 is ancient at this point, and you really should try to upgrade if you can.

Uninstalling nflgame should be done with pip uninstall nflgame. I'm not sure if that will also uninstall dependencies. (Such is life with pip.)

AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

Mmhmm. Yes. That is annoying. I will have to fix that. Hopefully later today.

Some day, when I add Python 3 compatibility, I will probably drop support for Python 2.6.

@anontemp123
Copy link
Author

All right so I should pip uninstall nflgame and then pip install nflgame again whenever you fix that? (Is that the best way to upgrade?)

@rkmaddox
Copy link

I have nflgame and nfldb installed for my user and both work fine.

@BurntSushi
Copy link
Owner

To upgrade, you should use pip install --upgrade nflgame.

And yes, nflgame will work if you install it with --user. It will also work inside a virtual environment.

@Kirkman
Copy link

Kirkman commented Sep 15, 2014

I made a little tweak to sched.py to fix 2.6 compatibility, but I can't seem to send you a pull request (I'm getting a weird error "Pull request creation failed. Validation failed: Base sha can't be blank")

Anyway, see it here:
https://github.com/Kirkman/nflgame/compare/BurntSushi:master...Kirkman:patch-1?expand=1

@hugovk
Copy link
Contributor

hugovk commented Oct 20, 2017

It's probably about time to drop support for Python 2.6 at this point:

Here's the pip installs for nflgame from PyPI for the last year:

$ pypinfo -d 365 --percent --pip nflgame pyversion
python_version percent download_count
-------------- ------- --------------
2.7              76.1%          3,144
3.5               9.4%            390
3.6               8.5%            352
3.4               5.3%            220
2.6               0.5%             22
3.7               0.1%              3
None              0.0%              1

@BurntSushi
Copy link
Owner

@hugovk You don't need to make the case. The only thing blocking progress on this is the will to do it.

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

5 participants