lm_nav icon indicating copy to clipboard operation
lm_nav copied to clipboard

Google Drive download Permission

Open gqlao0420 opened this issue 4 months ago • 0 comments

hello, I run the file 'jupyter_experiment.ipynb', when download the graph file, I get a 'Permission Denied' error. I can not access to the file from my browser, too.

How could I get your help?

Thank you very much.

CODE: url = f'https://drive.google.com/uc?id={graph_file_gdrive_id}' gdown.download(url, "graph.pkl") graph = NavigationGraph("graph.pkl")

ERROR:

TimeoutError Traceback (most recent call last) File ~/miniconda3/lib/python3.10/site-packages/urllib3/connection.py:174, in HTTPConnection._new_conn(self) 173 try: --> 174 conn = connection.create_connection( 175 (self._dns_host, self.port), self.timeout, **extra_kw 176 ) 178 except SocketTimeout:

File ~/miniconda3/lib/python3.10/site-packages/urllib3/util/connection.py:95, in create_connection(address, timeout, source_address, socket_options) 94 if err is not None: ---> 95 raise err 97 raise socket.error("getaddrinfo returns an empty list")

File ~/miniconda3/lib/python3.10/site-packages/urllib3/util/connection.py:85, in create_connection(address, timeout, source_address, socket_options) 84 sock.bind(source_address) ---> 85 sock.connect(sa) 86 return sock

TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

ConnectTimeoutError Traceback (most recent call last) File ~/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py:703, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 702 # Make the request on the httplib connection object. --> 703 httplib_response = self._make_request( 704 conn, 705 method, 706 url, 707 timeout=timeout_obj, 708 body=body, 709 headers=headers, 710 chunked=chunked, 711 ) 713 # If we're going to release the connection in finally:, then 714 # the response doesn't need to know about the connection. Otherwise 715 # it will also try to release it and we'll have a double-release 716 # mess.

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py:386, in HTTPConnectionPool._make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw) 385 try: --> 386 self._validate_conn(conn) 387 except (SocketTimeout, BaseSSLError) as e: 388 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py:1042, in HTTPSConnectionPool._validate_conn(self, conn) 1041 if not getattr(conn, "sock", None): # AppEngine might not have .sock -> 1042 conn.connect() 1044 if not conn.is_verified:

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connection.py:358, in HTTPSConnection.connect(self) 356 def connect(self): 357 # Add certificate verification --> 358 self.sock = conn = self._new_conn() 359 hostname = self.host

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connection.py:179, in HTTPConnection._new_conn(self) 178 except SocketTimeout: --> 179 raise ConnectTimeoutError( 180 self, 181 "Connection to %s timed out. (connect timeout=%s)" 182 % (self.host, self.timeout), 183 ) 185 except SocketError as e:

ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7f90edd476a0>, 'Connection to drive.google.com timed out. (connect timeout=None)')

During handling of the above exception, another exception occurred:

MaxRetryError Traceback (most recent call last) File ~/miniconda3/lib/python3.10/site-packages/requests/adapters.py:486, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 485 try: --> 486 resp = conn.urlopen( 487 method=request.method, 488 url=url, 489 body=request.body, 490 headers=request.headers, 491 redirect=False, 492 assert_same_host=False, 493 preload_content=False, 494 decode_content=False, 495 retries=self.max_retries, 496 timeout=timeout, 497 chunked=chunked, 498 ) 500 except (ProtocolError, OSError) as err:

File ~/miniconda3/lib/python3.10/site-packages/urllib3/connectionpool.py:787, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw) 785 e = ProtocolError("Connection aborted.", e) --> 787 retries = retries.increment( 788 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] 789 ) 790 retries.sleep()

File ~/miniconda3/lib/python3.10/site-packages/urllib3/util/retry.py:592, in Retry.increment(self, method, url, response, error, _pool, _stacktrace) 591 if new_retry.is_exhausted(): --> 592 raise MaxRetryError(_pool, url, error or ResponseError(cause)) 594 log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)

MaxRetryError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=186_WuE3caY0ADoaJrGurs9PACLsgSjup (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90edd476a0>, 'Connection to drive.google.com timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

ConnectTimeout Traceback (most recent call last) Cell In[4], line 3 1 url = f'https://drive.google.com/uc?id={graph_file_gdrive_id}' 2 print(url) ----> 3 gdown.download(url, "graph.pkl") 4 graph = NavigationGraph("graph.pkl")

File ~/miniconda3/lib/python3.10/site-packages/gdown/download.py:202, in download(url, output, quiet, proxy, speed, use_cookies, verify, id, fuzzy, resume, format, user_agent, log_messages) 199 is_gdrive_download_link = True 201 while True: --> 202 res = sess.get(url, stream=True, verify=verify) 204 if not (gdrive_file_id and is_gdrive_download_link): 205 break

File ~/miniconda3/lib/python3.10/site-packages/requests/sessions.py:602, in Session.get(self, url, **kwargs) 594 r"""Sends a GET request. Returns :class:Response object. 595 596 :param url: URL for the new :class:Request object. 597 :param **kwargs: Optional arguments that request takes. 598 :rtype: requests.Response 599 """ 601 kwargs.setdefault("allow_redirects", True) --> 602 return self.request("GET", url, **kwargs)

File ~/miniconda3/lib/python3.10/site-packages/requests/sessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 584 send_kwargs = { 585 "timeout": timeout, 586 "allow_redirects": allow_redirects, 587 } 588 send_kwargs.update(settings) --> 589 resp = self.send(prep, **send_kwargs) 591 return resp

File ~/miniconda3/lib/python3.10/site-packages/requests/sessions.py:703, in Session.send(self, request, **kwargs) 700 start = preferred_clock() 702 # Send the request --> 703 r = adapter.send(request, **kwargs) 705 # Total elapsed time of the request (approximately) 706 elapsed = preferred_clock() - start

File ~/miniconda3/lib/python3.10/site-packages/requests/adapters.py:507, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 504 if isinstance(e.reason, ConnectTimeoutError): 505 # TODO: Remove this in 3.0.0: see #2811 506 if not isinstance(e.reason, NewConnectionError): --> 507 raise ConnectTimeout(e, request=request) 509 if isinstance(e.reason, ResponseError): 510 raise RetryError(e, request=request)

ConnectTimeout: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=186_WuE3caY0ADoaJrGurs9PACLsgSjup (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f90edd476a0>, 'Connection to drive.google.com timed out. (connect timeout=None)'))

gqlao0420 avatar Oct 10 '24 12:10 gqlao0420