$ python darksky_example.py
Traceback (most recent call last):
File "darksky_example.py", line 1, in <module>
from darksky import forecast
File "darksky_example.py", line 4, in <module>
from darksky import forecast
ImportError: cannot import name 'forecast'
Using this exact code:
from darksky import forecast
from datetime import date, timedelta
BOSTON = 42.3601, 71.0589
weekday = date.today()
with forecast('API_KEY', *BOSTON) as boston:
print(boston.daily.summary)
for day in boston.daily:
day = dict(day = date.strftime(weekday, '%a'),
sum = day.summary,
tempMin = day.temperatureMin,
tempMax = day.temperatureMax
)
print('{day}: {sum} Temp range: {tempMin} - {tempMax}'.format(**day))
weekday += timedelta(days=1)
I installed via:
and get the following error:
Using this exact code:
Info: Python 3.6.9