Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. from geopy.geocoder import Nominatim
  2. nom=Nominatim(domain='http://localhost:8080')
  3. nom.geocode('some address') #the address works on the public server
  4.  
  5. ---------------------------------------------------------------------------
  6. gaierror Traceback (most recent call last)
  7. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
  8. 1253 try:
  9. -> 1254 h.request(req.get_method(), req.selector, req.data, headers)
  10. 1255 except OSError as err: # timeout error
  11.  
  12. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in request(self, method, url, body, headers)
  13. 1105 """Send a complete request to the server."""
  14. -> 1106 self._send_request(method, url, body, headers)
  15. 1107
  16.  
  17. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in _send_request(self, method, url, body, headers)
  18. 1150 body = _encode(body, 'body')
  19. -> 1151 self.endheaders(body)
  20. 1152
  21.  
  22. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in endheaders(self, message_body)
  23. 1101 raise CannotSendHeader()
  24. -> 1102 self._send_output(message_body)
  25. 1103
  26.  
  27. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in _send_output(self, message_body)
  28. 933
  29. --> 934 self.send(msg)
  30. 935 if message_body is not None:
  31.  
  32. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in send(self, data)
  33. 876 if self.auto_open:
  34. --> 877 self.connect()
  35. 878 else:
  36.  
  37. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in connect(self)
  38. 1251
  39. -> 1252 super().connect()
  40. 1253
  41.  
  42. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py in connect(self)
  43. 848 self.sock = self._create_connection(
  44. --> 849 (self.host,self.port), self.timeout, self.source_address)
  45. 850 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
  46.  
  47. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py in create_connection(address, timeout, source_address)
  48. 692 err = None
  49. --> 693 for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  50. 694 af, socktype, proto, canonname, sa = res
  51.  
  52. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py in getaddrinfo(host, port, family, type, proto, flags)
  53. 731 addrlist = []
  54. --> 732 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  55. 733 af, socktype, proto, canonname, sa = res
  56.  
  57. gaierror: [Errno 8] nodename nor servname provided, or not known
  58.  
  59. During handling of the above exception, another exception occurred:
  60.  
  61. URLError Traceback (most recent call last)
  62. /Users/nmbqz/.virtualenvs/scrapy/lib/python3.5/site-packages/geopy/geocoders/base.py in _call_geocoder(self, url, timeout, raw, requester, deserializer, **kwargs)
  63. 142 try:
  64. --> 143 page = requester(req, timeout=(timeout or self.timeout), **kwargs)
  65. 144 except Exception as error: # pylint: disable=W0703
  66.  
  67. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
  68. 162 opener = _opener
  69. --> 163 return opener.open(url, data, timeout)
  70. 164
  71.  
  72. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in open(self, fullurl, data, timeout)
  73. 465
  74. --> 466 response = self._open(req, data)
  75. 467
  76.  
  77. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in _open(self, req, data)
  78. 483 result = self._call_chain(self.handle_open, protocol, protocol +
  79. --> 484 '_open', req)
  80. 485 if result:
  81.  
  82. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
  83. 443 func = getattr(handler, meth_name)
  84. --> 444 result = func(*args)
  85. 445 if result is not None:
  86.  
  87. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in https_open(self, req)
  88. 1296 return self.do_open(http.client.HTTPSConnection, req,
  89. -> 1297 context=self._context, check_hostname=self._check_hostname)
  90. 1298
  91.  
  92. /usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
  93. 1255 except OSError as err: # timeout error
  94. -> 1256 raise URLError(err)
  95. 1257 r = h.getresponse()
  96.  
  97. URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  98.  
  99. During handling of the above exception, another exception occurred:
  100.  
  101. GeocoderServiceError Traceback (most recent call last)
  102. <ipython-input-141-ad9610064de4> in <module>()
  103. ----> 1 nom.geocode('Revontulentie 11')
  104.  
  105. /Users/nmbqz/.virtualenvs/scrapy/lib/python3.5/site-packages/geopy/geocoders/osm.py in geocode(self, query, exactly_one, timeout, addressdetails, language, geometry)
  106. 191 logger.debug("%s.geocode: %s", self.__class__.__name__, url)
  107. 192 return self._parse_json(
  108. --> 193 self._call_geocoder(url, timeout=timeout), exactly_one
  109. 194 )
  110. 195
  111.  
  112. /Users/nmbqz/.virtualenvs/scrapy/lib/python3.5/site-packages/geopy/geocoders/base.py in _call_geocoder(self, url, timeout, raw, requester, deserializer, **kwargs)
  113. 169 if "timed out" in message:
  114. 170 raise GeocoderTimedOut('Service timed out')
  115. --> 171 raise GeocoderServiceError(message)
  116. 172
  117. 173 if hasattr(page, 'getcode'):
  118.  
  119. GeocoderServiceError: [Errno 8] nodename nor servname provided, or not known
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement