astral icon indicating copy to clipboard operation
astral copied to clipboard

Import Method causes some attributes to work and others not to

Open Syntax-Er opened this issue 4 years ago • 0 comments

I had problems getting all the functions to run. I found that some worked and others didnt depending on the way astral is imported.

Some of errors I received were "module 'astral' has no attribute moon_phase" "type object 'Astral' has no attribute 'location' "

import astral - gets the location attribute to work from astral import Astral - got the moon_phase and most other functions working

To get both, manual location, and moonphase working I had to do both. import astral from astral import Astral ast = Astral()

now both of these will run without errors nyemoon = ast.moon_phase(date=datetime.date(2020,1,1)) location = los_altos = astral.Location(info=("Los Altos", "USA", 37.3681, -122.0975, "US/Pacific",50))

Syntax-Er avatar Dec 09 '19 04:12 Syntax-Er