Closed mxz2023 closed 1 year ago
Print out the value of ephem.__file__
. Maybe you are importing a file of your own that you have named ephem.py
, instead of importing my module?
Print out the value of
ephem.__file__
. Maybe you are importing a file of your own that you have namedephem.py
, instead of importing my module?
i run ephem is ok. you are right, it may be the PyCharm show a wrong message。but why PyCharm did show the message that Cannot find reference 'Sun' in 'init.py | init.py' . and i can't find the method of class define in the ephem module.
The Sun
object is defined dynamically from a table inside of the C module that PyEphem compiles — here's the code if you want to take a look:
https://github.com/brandon-rhodes/pyephem/blob/master/ephem/__init__.py#L90
If you are getting an error about the Sun
not being defined, you need to check ephem.__file__
to see what file is being loaded. Also, try print(dir(ephem))
and paste the results here, so we can see what symbols are defined in the file.
The
Sun
object is defined dynamically from a table inside of the C module that PyEphem compiles — here's the code if you want to take a look:https://github.com/brandon-rhodes/pyephem/blob/master/ephem/__init__.py#L90
If you are getting an error about the
Sun
not being defined, you need to checkephem.__file__
to see what file is being loaded. Also, tryprint(dir(ephem))
and paste the results here, so we can see what symbols are defined in the file.
thanks for your help, my problem was solved.
Thanks for making it back to close the issue, I'm glad things are working now.
When i use ephem.Sun(date), it show the info that Cannot find reference 'Sun' in 'init.py | init.py'
Python 3.10.13 ephem 4.1.5