ZeevG / python-forecast.io

A thin Python Wrapper for the Dark Sky (formerly forecast.io) weather API
http://zeevgilovitz.com/python-forecast.io/
Other
424 stars 88 forks source link

After installing python-forecastio, still cannnot import forecastio. #45

Closed HuangKY closed 7 years ago

HuangKY commented 7 years ago

I have install the forecastio, and used the command as follows.

$ pip install python-forecastio

and then I ran the sample here. https://gist.github.com/tjmcgi/c781881856b30cacef36 $ python forecastio.py

But...it seemed can not work successfully.

Traceback (most recent call last): File "forecastio.py", line 1, in import forecastio File "/home/huang/weather_test/forecastio.py", line 62, in forecast = forecastio.load_forecast('(API_Key)',35.689487,139.691706) AttributeError: 'module' object has no attribute 'load_forecast'

So I try to merely import the package in python. But it seemed I even cannot import the forecastio package.

$ import forecastio

Traceback (most recent call last): File "", line 1, in File "forecastio.py", line 62, in forecast = forecastio.load_forecast('(API_Key)',35.689487,139.691706) AttributeError: 'module' object has no attribute 'load_forecast'

I just follow all the steps and have checked if I have installed the package. Does anyone have any suggestion to solve this kind of problem ? Thank you very much.

BrianMitchL commented 7 years ago

Try renaming the file to be anything but 'forecastio.py', I think it's trying to import itself.

HuangKY commented 7 years ago

Thank you so much! You really pointed out the fundamental issue here. Thank you for you help.