ZeevG/python-forecast.io

After installing python-forecastio, still cannnot import forecastio.

Closed this issue · 2 comments

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.

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

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