Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
HuangKY opened this issue Aug 19, 2016 · 2 comments
Closed

Comments

@HuangKY
Copy link

HuangKY commented Aug 19, 2016

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
Copy link

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

@HuangKY
Copy link
Author

HuangKY commented Aug 22, 2016

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

@HuangKY HuangKY closed this as completed Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants