Python Forum
Error loading location on openweathermap via API with Kivy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error loading location on openweathermap via API with Kivy
#9
The query should be, according to my update (which I used as a patch but might be simply wrong):
API_key = "XXX"
base_url = "http://api.openweathermap.org/data/2.5/weather?"
search_template = base_url + "appid=" + API_key + "&q={}"
According to the manual, it should be:
search_template = "http://api.openweathermap.org/data/2.5/find?q={}&type=like" 
By running your listing https://openweathermap.org/find?q=Vancouver, I get:
File "/home/gigiux/Documents/main.py", line 30, in found_location
    data = json.loads(data.decode()) if not isinstance(data, dict) else data

AttributeError: 'str' object has no attribute 'decode'
Is this getting closer?
Reply


Messages In This Thread
RE: Error loading location on openweathermap via API with Kivy - by Gigux - Apr-23-2019, 06:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error when running kivy on python janeik 8 2,401 Jun-16-2023, 10:58 PM
Last Post: janeik
  Error loading Trelby.py blackclover 3 2,636 Jan-05-2021, 10:08 PM
Last Post: blackclover
  kivy - packaging touchtracer syntax error cram 2 2,672 Oct-14-2019, 08:30 PM
Last Post: cram
  Getting error while loading excel(.xlsx) file using openpyxl module shubhamjainj 1 9,184 Mar-01-2019, 01:05 PM
Last Post: buran
  error creating new object after loading pickled objects from file arogers 2 3,594 Feb-02-2019, 10:43 AM
Last Post: Larz60+
  PyQt5 No Error But GUI Window Not Loading digitalmatic7 1 4,423 Nov-21-2017, 05:23 PM
Last Post: digitalmatic7
  Error while loading the csv file Analyst 3 10,384 Oct-18-2017, 07:07 AM
Last Post: Analyst
  'NoneType' object has no attribute error, when using Kivy Screens chelovek 3 11,313 Feb-05-2017, 05:37 AM
Last Post: chelovek

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020