--------------------------------------------------------------------------- ConnectionRefusedError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py in _new_conn(self) 158 conn = connection.create_connection( --> 159 (self._dns_host, self.port), self.timeout, **extra_kw) 160 C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options) 79 if err is not None: ---> 80 raise err 81 C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options) 69 sock.bind(source_address) ---> 70 sock.connect(sa) 71 return sock ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it During handling of the above exception, another exception occurred: NewConnectionError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) body=body, headers=headers, --> 600 chunked=chunked) 601 C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 353 else: --> 354 conn.request(method, url, **httplib_request_kw) 355 C:\ProgramData\Anaconda3\lib\http\client.py in request(self, method, url, body, headers, encode_chunked) 1228 """Send a complete request to the server.""" -> 1229 self._send_request(method, url, body, headers, encode_chunked) 1230 C:\ProgramData\Anaconda3\lib\http\client.py in _send_request(self, method, url, body, headers, encode_chunked) 1274 body = _encode(body, 'body') -> 1275 self.endheaders(body, encode_chunked=encode_chunked) 1276 C:\ProgramData\Anaconda3\lib\http\client.py in endheaders(self, message_body, encode_chunked) 1223 raise CannotSendHeader() -> 1224 self._send_output(message_body, encode_chunked=encode_chunked) 1225 C:\ProgramData\Anaconda3\lib\http\client.py in _send_output(self, message_body, encode_chunked) 1015 del self._buffer[:] -> 1016 self.send(msg) 1017 C:\ProgramData\Anaconda3\lib\http\client.py in send(self, data) 955 if self.auto_open: --> 956 self.connect() 957 else: C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py in connect(self) 180 def connect(self): --> 181 conn = self._new_conn() 182 self._prepare_conn(conn) C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py in _new_conn(self) 167 raise NewConnectionError( --> 168 self, "Failed to establish a new connection: %s" % e) 169 NewConnectionError: : Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it During handling of the above exception, another exception occurred: MaxRetryError Traceback (most recent call last) C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 448 retries=self.max_retries, --> 449 timeout=timeout 450 ) C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 637 retries = retries.increment(method, url, error=e, _pool=self, --> 638 _stacktrace=sys.exc_info()[2]) 639 retries.sleep() C:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\retry.py in increment(self, method, url, response, error, _pool, _stacktrace) 398 if new_retry.is_exhausted(): --> 399 raise MaxRetryError(_pool, url, error or ResponseError(cause)) 400 MaxRetryError: HTTPConnectionPool(host='localhost', port=36036): Max retries exceeded with url: /api/v1/data (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) During handling of the above exception, another exception occurred: ConnectionError Traceback (most recent call last) in 1 import requests ----> 2 r =requests.get('http://localhost:36036/api/v1/data') 3 r.status_code C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py in get(url, params, **kwargs) 73 74 kwargs.setdefault('allow_redirects', True) ---> 75 return request('get', url, params=params, **kwargs) 76 77 C:\ProgramData\Anaconda3\lib\site-packages\requests\api.py in request(method, url, **kwargs) 58 # cases, and look like a memory leak in others. 59 with sessions.Session() as session: ---> 60 return session.request(method=method, url=url, **kwargs) 61 62 C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 531 } 532 send_kwargs.update(settings) --> 533 resp = self.send(prep, **send_kwargs) 534 535 return resp C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py in send(self, request, **kwargs) 644 645 # Send the request --> 646 r = adapter.send(request, **kwargs) 647 648 # Total elapsed time of the request (approximately) C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py in send(self, request, stream, timeout, verify, cert, proxies) 514 raise SSLError(e, request=request) 515 --> 516 raise ConnectionError(e, request=request) 517 518 except ClosedPoolError as e: ConnectionError: HTTPConnectionPool(host='localhost', port=36036): Max retries exceeded with url: /api/v1/data (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))