I am trying to run the library on Windows 7 having Python 3.4. installed. I executed the script manually as follows:
$ python openweather.py -s 4885
OpenWeather.do_request() got unknown exception: <class 'AttributeError'> (1. attempt)
OpenWeather.do_request() got unknown exception: <class 'AttributeError'> (2. attempt)
OpenWeather.do_request() got unknown exception: <class 'AttributeError'> (3. attempt)
Traceback (most recent call last):
File "D:\Wetter\openweather.py", line 235, in <module>
main()
File "D:\Wetter\openweather.py", line 232, in main
print(json.dumps(flatten_dict(weather), indent=4, sort_keys=True))
File "D:\Wetter\openweather.py", line 154, in flatten_dict
for k, v in d.items():
AttributeError: 'NoneType' object has no attribute 'items'
From what I could find out there are version issues with urllib being using in line 132. Here is what I found:
Note: The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
This seems to be a problem with Python 3.4, the script basically works with Python 2.7.8 - see issue #6. Please note in the README.md that people should use Python 2.7.x.
I am trying to run the library on Windows 7 having Python 3.4. installed. I executed the script manually as follows:
From what I could find out there are version issues with
urllib
being using in line 132. Here is what I found:Source
This seems to be a problem with Python 3.4, the script basically works with Python 2.7.8 - see issue #6. Please note in the
README.md
that people should use Python 2.7.x.