skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.42k stars 213 forks source link

Question on skyfield modules for Raspberry Pi #583

Closed newcubes closed 3 years ago

newcubes commented 3 years ago

First off, thank you so much for building this amazing resource. I am controlling content in a web app on a raspberry pi with skyfield. Several of the modules are not loading correctly. For example, the "ecliptic_frame" from skyfield.framelib cannot import. Others like N, W, wgs84 etc from skyfield.api also fail to import.

Everything works great when I run from my mac.

Any insight would be super appreciated. Thanks so much!

-Austin

brandon-rhodes commented 3 years ago

Do any of your own modules happen to have the same name as either skyfield (like skyfield.py) or else the name of one of Python's built-in modules that Skyfield might use? Seeing exactly your specific error message would help with diagnosis.

newcubes commented 3 years ago
Screen Shot 2021-04-14 at 2 01 31 PM Screen Shot 2021-04-14 at 2 02 27 PM

This is a simple example. I am running your solar noon example out of the box on a pi. I dont have any of my own modules so far. As you can see it cannot import N from skyfield.api. thanks so much

brandon-rhodes commented 3 years ago

What version of Skyfield is it? Try:

import skyfield.api
print(skyfield.__version__)
print(dir(skyfield.api))
newcubes commented 3 years ago
Screen Shot 2021-04-14 at 2 23 15 PM
brandon-rhodes commented 3 years ago

Ah! That answers the question. You're using old Skyfield 1.31, before those options were added to the api module. You'll want to either upgrade, or fall back to consulting the old versions of the Skyfield docs that come built-in to its skyfield/documentation/ directory and that will match the version that's installed.

newcubes commented 3 years ago

That did it. TYSM! Can I don't to the project anywhere?

brandon-rhodes commented 3 years ago

Wow — yes: look for a "Sponsor" link up near the top of this page and click "One-time" — thank you for thinking of it!

(And, I'm glad your problem is solved!)

brandon-rhodes commented 3 years ago

(I'm going to go ahead and close this issue as it sounds like it's resolved, but feel free to follow up with more comments, or re-open if you need to.)