I am trying to retrieve the results from a job run on the neuromphic platform using the nmpi client. After I enter my password, the cell will not finish execution. Even if I wait for hours. This is the code I use to retrieve the data:
from nmpi import Client
client = Client("myusername")
job = client.get_job(92109)
client.download_data(job)
However I could also boil down the problem a bit, and found that the actual error happens, when the Client
tries this:
requests.get('https://nmpi.hbpneuromorphic.eu/api/v2/')
Running the line in the jupyter notebook will hang, running it on my machine here it succeeds immediately. Any help to fix this is appreciated.
Here is the I obtain, when interrupting the get request:
KeyboardInterrupt Traceback (most recent call last)
<ipython-input-4-afd053debd07> in <module>()
1 import requests
----> 2 requests.get('https://nmpi.hbpneuromorphic.eu/api/v2/')
/usr/local/lib/python2.7/dist-packages/requests/api.pyc in get(url, params, **kwargs)
68
69 kwargs.setdefault('allow_redirects', True)
---> 70 return request('get', url, params=params, **kwargs)
71
72
/usr/local/lib/python2.7/dist-packages/requests/api.pyc in request(method, url, **kwargs)
54 # cases, and look like a memory leak in others.
55 with sessions.Session() as session:
---> 56 return session.request(method=method, url=url, **kwargs)
57
58
/usr/local/lib/python2.7/dist-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
473 }
474 send_kwargs.update(settings)
--> 475 resp = self.send(prep, **send_kwargs)
476
477 return resp
/usr/local/lib/python2.7/dist-packages/requests/sessions.pyc in send(self, request, **kwargs)
594
595 # Send the request
--> 596 r = adapter.send(request, **kwargs)
597
598 # Total elapsed time of the request (approximately)
/usr/local/lib/python2.7/dist-packages/requests/adapters.pyc in send(self, request, stream, timeout, verify, cert, proxies)
421 decode_content=False,
422 retries=self.max_retries,
--> 423 timeout=timeout
424 )
425
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, **response_kw)
593 timeout=timeout_obj,
594 body=body, headers=headers,
--> 595 chunked=chunked)
596
597 # If we're going to release the connection in ``finally:``, then
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
350 # Trigger any extra validation we need to do.
351 try:
--> 352 self._validate_conn(conn)
353 except (SocketTimeout, BaseSSLError) as e:
354 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _validate_conn(self, conn)
829 # Force connect early to allow us to validate the connection.
830 if not getattr(conn, 'sock', None): # AppEngine might not have `.sock`
--> 831 conn.connect()
832
833 if not conn.is_verified:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connection.pyc in connect(self)
287 ca_cert_dir=self.ca_cert_dir,
288 server_hostname=hostname,
--> 289 ssl_version=resolved_ssl_version)
290
291 if self.assert_fingerprint:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/contrib/pyopenssl.pyc in ssl_wrap_socket(sock, keyfile, certfile, cert_reqs, ca_certs, server_hostname, ssl_version, ca_cert_dir)
346 while True:
347 try:
--> 348 cnx.do_handshake()
349 except OpenSSL.SSL.WantReadError:
350 rd, _, _ = select.select([sock], [], [], sock.gettimeout())
/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.pyc in do_handshake(self)
1423 :return: None.
1424 """
-> 1425 result = _lib.SSL_do_handshake(self._ssl)
1426 self._raise_ssl_error(self._ssl, result)
1427
KeyboardInterrupt: