0
0 комментариев
  1. Версия Python 3.8

2) Windows 10

3) Код:

import pyowm

owm = pyowm.OWM('df59d197efaf7fcd6181ebe7d3c02dac',language = "RU")

place = input("В каком городе? ")
observation = owm.weather_at_place(place)
w = observation.get_weather()

print("В городе " + place + " сейчас " +
w.get_detailed_status())
temp = w.get_temperature('celsius')['temp']
print('Температура в районе: ' + str(temp) + '°C')
4)certifi==2019.11.28
chardet==3.0.4
geojson==2.5.0
idna==2.9
pyowm==2.10.0
requests==2.23.0
urllib3==1.25.8
5)
  • Traceback (most recent call last):
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\connectionpool.py«, line 421, in _make_request
    six.raise_from(e, None)
    File «<string>», line 3, in raise_from
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\connectionpool.py«, line 416, in _make_request
    httplib_response = conn.getresponse()
    File «C:\pythom 3.8.2\lib\http\client.py«, line 1322, in getresponse
    response.begin()
    File «C:\pythom 3.8.2\lib\http\client.py«, line 303, in begin
    version, status, reason = self._read_status()
    File «C:\pythom 3.8.2\lib\http\client.py«, line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), «iso-8859-1»)
    File «C:\pythom 3.8.2\lib\socket.py«, line 669, in readinto
    return self._sock.recv_into(b)
    socket.timeout: timed out

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\requests\adapters.py«, line 439, in send
    resp = conn.urlopen(
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\connectionpool.py«, line 719, in urlopen
    retries = retries.increment(
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\util\retry.py«, line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\packages\six.py«, line 735, in reraise
    raise value
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\connectionpool.py«, line 665, in urlopen
    httplib_response = self._make_request(
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\connectionpool.py«, line 423, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\urllib3\connectionpool.py«, line 330, in _raise_timeout
    raise ReadTimeoutError(
    urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host=’api.openweathermap.org‘, port=80): Read timed out. (read timeout=2)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\pyowm\commons\http_client.py«, line 24, in get_json
    resp = requests.get(uri, params=params, headers=headers,
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\requests\api.py«, line 76, in get
    return request(‘get’, url, params=params, **kwargs)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\requests\api.py«, line 61, in request
    return session.request(method=method, url=url, **kwargs)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\requests\sessions.py«, line 530, in request
    resp = self.send(prep, **send_kwargs)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\requests\sessions.py«, line 643, in send
    r = adapter.send(request, **kwargs)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\lib\site-packages\requests\adapters.py«, line 529, in send
    raise ReadTimeout(e, request=request)
    requests.exceptions.ReadTimeout: HTTPConnectionPool(host=’api.openweathermap.org‘, port=80): Read timed out. (read timeout=2)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File «C:/Users/DANTES/PycharmProjects/popitki/POGODA.py«, line 6, in <module>
    observation = owm.weather_at_place(place)
    File «C:\Users\DANTES\PycharmProjects\popitki\venv\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\DANTES\PycharmProjects\popitki\venv\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\DANTES\PycharmProjects\popitki\venv\lib\site-packages\pyowm\commons\http_client.py«, line 31, in get_json
    raise api_call_error.APICallTimeoutError(‘API call timeouted’)
    pyowm.exceptions.api_call_error.APICallTimeoutError: Exception in calling OWM Weather API.
    Reason: API call timeouted
    Caused by: None

    Process finished with exit code 1


Добавить комментарий