skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.41k stars 211 forks source link

skyfield supports python 2.6+, but jplephem is 2.7+ #248

Closed drysdam closed 5 years ago

drysdam commented 5 years ago

For Reasons, I'm stuck on 2.6 for now. I don't want to use any planetary stuff, which seems to be what the JPL library is about. Is there a way to avoid requiring it?

brandon-rhodes commented 5 years ago

It looks like jplephem became incompatible with Python 2.6 about a year ago; this is the failing Travis CI build that convinced me to remove "2.6" from the list of compatible versions, but I can't remember now exactly what the bug was that I couldn't work around:

https://travis-ci.org/brandon-rhodes/python-jplephem/jobs/339297896

If you use an older version of Skyfield that depends on jplephem 2.6 or earlier (oh, that's an odd coincidence; jplephem lost 2.6 compatibility with its own version 2.7!), then I think you'll find that it installs and runs fine.

Alternatively, you could install an old version of jplephem and install Skyfield's other dependencies, then run "pip install --no-deps skyfield" and it might go ahead and install without caring that your jplephem is a bit too old.

I would be very interested to learn more about your situation, as when I'm at PyCon in a couple of weeks I'll probably hear folks say "I'm no longer supporting Python 2, it's been a decade!", and they will wonder why some of my libraries still support the even older Python 2.6. It would be helpful to have a concrete example to give them of why it helps people out to keep supporting old versions!

drysdam commented 5 years ago

Using an older skyfield is a good idea. I'd be trapped back there, but that's the case with a lot of libraries and I'm sure the basic satellite code probably still works. Do you happen to know which version that is?

My situation is that I need to be able to run on computers don't get their OSes updated very often and when they do it's always with something that's a few years behind the cutting edge. A combination of operational machines that control hardware combined with security requirements dictate these conditions.

I'm far from alone, but Python enthusiasts (as opposed to mere software engineers) seem to really love the upgrade treadmill more than almost any other language users with the exception of web devs.

brandon-rhodes commented 5 years ago

I just checked, and the setup.py of Skyfield doesn't look like it's ever required a version of jplephem later than about 2.3, so I don't think there's any requirement that jplephem be recent. I think you can simply install it at an older version and Skyfield will be fine! Maybe pip install skyfield jplephem=2.6 would work?

drysdam commented 5 years ago

Yep, this worked, thanks! (Also, skyfield is awesome!)

brandon-rhodes commented 5 years ago

Thanks! I'm glad that we figured out how to support Python 2.6 for you. And, when I'm at PyCon in a few weeks, I'll be mentioning to people that Python 2.6 support is not in vain! :)

brandon-rhodes commented 5 years ago

@drysdam When I mentioned Python 2.6 on Twitter earlier today, someone asked an interesting question: had you tried using "pyenv" to get Python 2.7 installed? I didn't know the answer, so I thought I would ask; I had forgotten that a command existed that (if I understand correctly?) can install Python 2.7 under a user account without the person needing admin access.

drysdam commented 5 years ago

I haven't used it, because it doesn't solve my problem. It's for a community of users, not a single one. But more importantly, it isn't that I need admin access. It's that, for security reasons, I'm not allowed to install "software" but "scripts" are allowed. (I know that's a nonsensical distinction--I didn't make the rules.) So I can't install python2.7, but I can give them a python2.6 script.

This isn't some weird corner case, either. This is a standard government security deal.

brandon-rhodes commented 5 years ago

“It's for a community of users, not a single one.” — Thank you! That is exactly what I was guessing, that you weren't doing something limited to your single user account, but wanting to make something available more widely to a group of users all on the same platform.

And I'll look this weekend at whether jplephem could be moved back in line with 2.6 support, just in case it was a small trivial issue I can reverse!

drysdam commented 5 years ago

Awesome, thanks! Although jplephem 2.6 did in fact work.