0
0 комментариев

import pyowm

owm = pyowm.OWM(‘6937fc6df62c62c3b24a6e22ce059879’)

place = input(«В каком городе/стране вы живете: «)

observation = owm.weather_at_place(place)
w = observation.get_weather()

print(w)

и выдает ошибку

В каком городе/стране вы живете: Казань
Traceback (most recent call last):
File «task2.py», line 7, in <module>
observation = owm.weather_at_place(place)
File «C:\Users\knock\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyowm\weatherapi25\owm25.py», line 231, in weather_at_place
_, json_data = self._wapi.cacheable_get_json(uri, params=params)
File «C:\Users\knock\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyowm\commons\http_client.py», line 87, in cacheable_get_json
status_code, data = self.get_json(uri, params=params, headers=headers)
File «C:\Users\knock\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyowm\commons\http_client.py», line 32, in get_json
HttpClient.check_status_code(resp.status_code, resp.text)
File «C:\Users\knock\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyowm\commons\http_client.py», line 153, in check_status_code
raise api_response_error.UnauthorizedError(‘Invalid API Key provided’)
pyowm.exceptions.api_response_error.UnauthorizedError: Your API subscription level does not allow to perform this operation
Reason: Invalid API Key provided

Решенный вопрос
Добавить комментарий