Python3: Geopy Nominatim() возвращает ошибку 503: служба недоступна. Используя Блокнот Юпитера
Итак, у меня есть небольшой файл CSV, я пытаюсь геокодировать адреса в файле CSV. Тем не менее, я продолжаю получать следующую ошибку: я пытался увеличить время ожидания для Nominatim(), не помогло. Я получаю сообщение об ошибке 503: служба недоступна.
locator = Nominatim(timeout=20)
location = locator.geocode("3995 23rd St, San Francisco, CA 94114")
HTTPError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/geopy/geocoders/base.py in _call_geocoder(self, url, timeout, raw, requester, deserializer, **kwargs)
142 try:
--> 143 page = requester(req, timeout=(timeout or self.timeout), **kwargs)
144 except Exception as error: # pylint: disable=W0703
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
222 opener = _opener
--> 223 return opener.open(url, data, timeout)
224
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
531 meth = getattr(processor, meth_name)
--> 532 response = meth(req, response)
533
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in http_response(self, request, response)
641 response = self.parent.error(
--> 642 'http', request, response, code, msg, hdrs)
643
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in error(self, proto, *args)
569 args = (dict, 'default', 'http_error_default') + orig_args
--> 570 return self._call_chain(*args)
571
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
503 func = getattr(handler, meth_name)
--> 504 result = func(*args)
505 if result is not None:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
649 def http_error_default(self, req, fp, code, msg, hdrs):
--> 650 raise HTTPError(req.full_url, code, msg, hdrs, fp)
651
HTTPError: HTTP Error 503: Service Unavailable
During handling of the above exception, another exception occurred:
GeocoderTimedOut Traceback (most recent call last)
<ipython-input-35-d2fc7acdfd40> in <module>()
----> 1 location = locator.geocode("3995 23rd St, San Francisco, CA 94114")
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/geopy/geocoders/osm.py in geocode(self, query, exactly_one, timeout, addressdetails, language, geometry)
191 logger.debug("%s.geocode: %s", self.__class__.__name__, url)
192 return self._parse_json(
--> 193 self._call_geocoder(url, timeout=timeout), exactly_one
194 )
195
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/geopy/geocoders/base.py in _call_geocoder(self, url, timeout, raw, requester, deserializer, **kwargs)
156 code = error.getcode()
157 try:
--> 158 raise ERROR_CODE_MAP[code](message)
159 except KeyError:
160 raise GeocoderServiceError(message)
GeocoderTimedOut: HTTP Error 503: Service Unavailable