Code Monkey home page Code Monkey logo

Comments (7)

giswqs avatar giswqs commented on May 18, 2024

@gaowudao Keep in mind that Google is blocked in China. If you are trying to use Google Earth Engine in China, you need to deal with the Great Firewall. Otherwise, you won't be able to connect to Earth Engine, which will result in timed out errors.

from geemap.

gaowudao avatar gaowudao commented on May 18, 2024

@giswqs Yeah, understood. Thank you very much. Really wanna learn geemap in JupyterLab

from geemap.

gaowudao avatar gaowudao commented on May 18, 2024

@giswqs Ok, another question: I have solved the timed out problems. Then, there is a problem in jupyterLab:
import geemap
Map = geemap.Map(center=[40,-100], zoom=4)
Map

Error displaying widget: model not found

However, It works fine and show the map in jupyter notebook.

from geemap.

giswqs avatar giswqs commented on May 18, 2024

You might need to install the JupyterLab extension (source):

jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-leaflet

from geemap.

gaowudao avatar gaowudao commented on May 18, 2024

@giswqs Wow, Thank you very much, two problems have been solved in a few minutes. I am learning the geemap through lessons in youtube. Nice work.

from geemap.

giswqs avatar giswqs commented on May 18, 2024

Good to know that it worked. Feel free to open a new issue if you encounter any problems with geemap.

from geemap.

WHU-Lavine avatar WHU-Lavine commented on May 18, 2024

I used VPN but still got the same timeout problem,
and I tried to use Anaconda to install a new env(python3.7),and installed the jupyter notebook but when I started it,I got kernel error.
thanks

Enter verification code: 4/3QF3LgB9d3PTWp7yL0m72hnKv4TWQglU7O6yn6SFknSBp7mgfD_X1RQ

Successfully saved authorization token.

TimeoutError Traceback (most recent call last)
E:\anaconda\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

E:\anaconda\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

E:\anaconda\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

TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

NewConnectionError Traceback (most recent call last)
E:\anaconda\lib\site-packages\httplib2shim_init_.py in _conn_request(self, conn, request_uri, method, body, headers)
147 timeout=urllib3.Timeout(total=self.timeout),
--> 148 decode_content=decode)
149

E:\anaconda\lib\site-packages\urllib3\request.py in request(self, method, url, fields, headers, **urlopen_kw)
71 headers=headers,
---> 72 **urlopen_kw)
73

E:\anaconda\lib\site-packages\urllib3\request.py in request_encode_body(self, method, url, fields, headers, encode_multipart, multipart_boundary, **urlopen_kw)
149
--> 150 return self.urlopen(method, url, **extra_kw)

E:\anaconda\lib\site-packages\urllib3\poolmanager.py in urlopen(self, method, url, redirect, **kw)
323 else:
--> 324 response = conn.urlopen(method, u.request_uri, **kw)
325

E:\anaconda\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()

E:\anaconda\lib\site-packages\urllib3\util\retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
343 # Disabled, indicate to re-raise the error.
--> 344 raise six.reraise(type(error), error, _stacktrace)
345

E:\anaconda\lib\site-packages\urllib3\packages\six.py in reraise(tp, value, tb)
685 raise value.with_traceback(tb)
--> 686 raise value
687

E:\anaconda\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)
599 body=body, headers=headers,
--> 600 chunked=chunked)
601

E:\anaconda\lib\site-packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
342 try:
--> 343 self._validate_conn(conn)
344 except (SocketTimeout, BaseSSLError) as e:

E:\anaconda\lib\site-packages\urllib3\connectionpool.py in _validate_conn(self, conn)
838 if not getattr(conn, 'sock', None): # AppEngine might not have .sock
--> 839 conn.connect()
840

E:\anaconda\lib\site-packages\urllib3\connection.py in connect(self)
300 # Add certificate verification
--> 301 conn = self._new_conn()
302 hostname = self.host

E:\anaconda\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: <urllib3.connection.VerifiedHTTPSConnection object at 0x0CF27750>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

timeout Traceback (most recent call last)
E:\anaconda\lib\site-packages\geemap\geemap.py in ee_initialize(token_name)
36
---> 37 ee.Initialize()
38 except:

E:\anaconda\lib\site-packages\ee_init_.py in Initialize(credentials, opt_url, use_cloud_api, cloud_api_key, http_transport, project)
122 project=project,
--> 123 http_transport=http_transport)
124 # Initialize the dynamically loaded functions on the objects that want them.

E:\anaconda\lib\site-packages\ee\data.py in initialize(credentials, api_base_url, tile_base_url, use_cloud_api, cloud_api_base_url, cloud_api_key, project, http_transport)
209
--> 210 _install_cloud_api_resource()
211

E:\anaconda\lib\site-packages\ee\data.py in _install_cloud_api_resource()
286 response_inspector=_handle_profiling_response,
--> 287 http_transport=_http_transport)
288

E:\anaconda\lib\site-packages\ee_cloud_api_utils.py in build_cloud_resource(api_base_url, api_key, credentials, timeout, headers_supplier, response_inspector, http_transport, raw)
148 requestBuilder=request_builder,
--> 149 model=alt_model)
150 return resource

E:\anaconda\lib\site-packages\googleapiclient_helpers.py in positional_wrapper(*args, **kwargs)
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135

E:\anaconda\lib\site-packages\googleapiclient\discovery.py in build(serviceName, version, http, discoveryServiceUrl, developerKey, model, requestBuilder, credentials, cache_discovery, cache, client_options, adc_cert_path, adc_key_path, num_retries)
249 requested_url, discovery_http, cache_discovery, cache,
--> 250 developerKey, num_retries=num_retries
251 )

E:\anaconda\lib\site-packages\googleapiclient\discovery.py in _retrieve_discovery_doc(url, http, cache_discovery, cache, developerKey, num_retries)
315 req = HttpRequest(http, HttpRequest.null_postproc, actual_url)
--> 316 resp, content = req.execute(num_retries=num_retries)
317

E:\anaconda\lib\site-packages\googleapiclient_helpers.py in positional_wrapper(*args, **kwargs)
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135

E:\anaconda\lib\site-packages\googleapiclient\http.py in execute(self, http, num_retries)
900 body=self.body,
--> 901 headers=self.headers,
902 )

E:\anaconda\lib\site-packages\googleapiclient\http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs)
203 if retry_num == num_retries:
--> 204 raise exception
205 else:

E:\anaconda\lib\site-packages\googleapiclient\http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs)
176 exception = None
--> 177 resp, content = http.request(uri, method, *args, **kwargs)
178 # Retry on SSL errors and socket timeout errors.

E:\anaconda\lib\site-packages\google_auth_httplib2.py in request(self, uri, method, body, headers, **kwargs)
189 self.credentials.before_request(
--> 190 self._request, method, uri, request_headers)
191

E:\anaconda\lib\site-packages\google\auth\credentials.py in before_request(self, request, method, url, headers)
132 if not self.valid:
--> 133 self.refresh(request)
134 self.apply(headers)

E:\anaconda\lib\site-packages\google\oauth2\credentials.py in refresh(self, request)
197 self._client_secret,
--> 198 self._scopes,
199 )

E:\anaconda\lib\site-packages\google\oauth2_client.py in refresh_grant(request, token_uri, refresh_token, client_id, client_secret, scopes)
247
--> 248 response_data = _token_endpoint_request(request, token_uri, body)
249

E:\anaconda\lib\site-packages\google\oauth2_client.py in _token_endpoint_request(request, token_uri, body)
104 while True:
--> 105 response = request(method="POST", url=token_uri, headers=headers, body=body)
106 response_body = (

E:\anaconda\lib\site-packages\google_auth_httplib2.py in call(self, url, method, body, headers, timeout, **kwargs)
116 response, data = self.http.request(
--> 117 url, method=method, body=body, headers=headers, **kwargs)
118 return _Response(response, data)

E:\anaconda\lib\site-packages\httplib2_init_.py in request(self, uri, method, body, headers, redirections, connection_type)
1993 redirections,
-> 1994 cachekey,
1995 )

E:\anaconda\lib\site-packages\httplib2_init_.py in _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey)
1650 (response, content) = self._conn_request(
-> 1651 conn, request_uri, method, body, headers
1652 )

E:\anaconda\lib\site-packages\httplib2shim_init_.py in _conn_request(self, conn, request_uri, method, body, headers)
153 except Exception as e:
--> 154 raise _map_exception(e)
155

timeout: timed out

During handling of the above exception, another exception occurred:

timeout Traceback (most recent call last)
in
----> 1 geemap.ee_search()

E:\anaconda\lib\site-packages\geemap\geemap.py in ee_search(asset_limit)
5059 display(search_widget)
5060
-> 5061 repo_tree, repo_output, _ = build_repo_tree()
5062 left_widget.children = [search_type, repo_tree]
5063 right_widget.children = [repo_output]

E:\anaconda\lib\site-packages\geemap\geemap.py in build_repo_tree(out_dir, name)
5307 }
5308
-> 5309 user_id = ee_user_id()
5310 if user_id is not None:
5311 URLs['Owner'] = 'https://earthengine.googlesource.com/{}/default'.format(

E:\anaconda\lib\site-packages\geemap\geemap.py in ee_user_id()
5149 str: A string containing the user id.
5150 """
-> 5151 ee_initialize()
5152 roots = ee.data.getAssetRoots()
5153 if len(roots) == 0:

E:\anaconda\lib\site-packages\geemap\geemap.py in ee_initialize(token_name)
38 except:
39 ee.Authenticate()
---> 40 ee.Initialize()
41
42

E:\anaconda\lib\site-packages\ee_init_.py in Initialize(credentials, opt_url, use_cloud_api, cloud_api_key, http_transport, project)
121 cloud_api_key=cloud_api_key,
122 project=project,
--> 123 http_transport=http_transport)
124 # Initialize the dynamically loaded functions on the objects that want them.
125 ApiFunction.initialize()

E:\anaconda\lib\site-packages\ee\data.py in initialize(credentials, api_base_url, tile_base_url, use_cloud_api, cloud_api_base_url, cloud_api_key, project, http_transport)
208 _http_transport = http_transport
209
--> 210 _install_cloud_api_resource()
211
212 if project is not None:

E:\anaconda\lib\site-packages\ee\data.py in _install_cloud_api_resource()
285 headers_supplier=_make_request_headers,
286 response_inspector=_handle_profiling_response,
--> 287 http_transport=_http_transport)
288
289 _cloud_api_resource_raw = _cloud_api_utils.build_cloud_resource(

E:\anaconda\lib\site-packages\ee_cloud_api_utils.py in build_cloud_resource(api_base_url, api_key, credentials, timeout, headers_supplier, response_inspector, http_transport, raw)
147 http=http_transport,
148 requestBuilder=request_builder,
--> 149 model=alt_model)
150 return resource
151

E:\anaconda\lib\site-packages\googleapiclient_helpers.py in positional_wrapper(*args, **kwargs)
132 elif positional_parameters_enforcement == POSITIONAL_WARNING:
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135
136 return positional_wrapper

E:\anaconda\lib\site-packages\googleapiclient\discovery.py in build(serviceName, version, http, discoveryServiceUrl, developerKey, model, requestBuilder, credentials, cache_discovery, cache, client_options, adc_cert_path, adc_key_path, num_retries)
248 content = _retrieve_discovery_doc(
249 requested_url, discovery_http, cache_discovery, cache,
--> 250 developerKey, num_retries=num_retries
251 )
252 return build_from_document(

E:\anaconda\lib\site-packages\googleapiclient\discovery.py in _retrieve_discovery_doc(url, http, cache_discovery, cache, developerKey, num_retries)
314 # Note that it will already raise an error if we don't get a 2xx response
315 req = HttpRequest(http, HttpRequest.null_postproc, actual_url)
--> 316 resp, content = req.execute(num_retries=num_retries)
317
318 try:

E:\anaconda\lib\site-packages\googleapiclient_helpers.py in positional_wrapper(*args, **kwargs)
132 elif positional_parameters_enforcement == POSITIONAL_WARNING:
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135
136 return positional_wrapper

E:\anaconda\lib\site-packages\googleapiclient\http.py in execute(self, http, num_retries)
899 method=str(self.method),
900 body=self.body,
--> 901 headers=self.headers,
902 )
903

E:\anaconda\lib\site-packages\googleapiclient\http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs)
202 if exception:
203 if retry_num == num_retries:
--> 204 raise exception
205 else:
206 continue

E:\anaconda\lib\site-packages\googleapiclient\http.py in _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args, **kwargs)
175 try:
176 exception = None
--> 177 resp, content = http.request(uri, method, *args, **kwargs)
178 # Retry on SSL errors and socket timeout errors.
179 except _ssl_SSLError as ssl_error:

E:\anaconda\lib\site-packages\google_auth_httplib2.py in request(self, uri, method, body, headers, **kwargs)
188
189 self.credentials.before_request(
--> 190 self._request, method, uri, request_headers)
191
192 # Check if the body is a file-like stream, and if so, save the body

E:\anaconda\lib\site-packages\google\auth\credentials.py in before_request(self, request, method, url, headers)
131 # the http request.)
132 if not self.valid:
--> 133 self.refresh(request)
134 self.apply(headers)
135

E:\anaconda\lib\site-packages\google\oauth2\credentials.py in refresh(self, request)
196 self._client_id,
197 self._client_secret,
--> 198 self._scopes,
199 )
200

E:\anaconda\lib\site-packages\google\oauth2_client.py in refresh_grant(request, token_uri, refresh_token, client_id, client_secret, scopes)
246 body["scope"] = " ".join(scopes)
247
--> 248 response_data = _token_endpoint_request(request, token_uri, body)
249
250 try:

E:\anaconda\lib\site-packages\google\oauth2_client.py in _token_endpoint_request(request, token_uri, body)
103 # occurs.
104 while True:
--> 105 response = request(method="POST", url=token_uri, headers=headers, body=body)
106 response_body = (
107 response.data.decode("utf-8")

E:\anaconda\lib\site-packages\google_auth_httplib2.py in call(self, url, method, body, headers, timeout, **kwargs)
115 _LOGGER.debug('Making request: %s %s', method, url)
116 response, data = self.http.request(
--> 117 url, method=method, body=body, headers=headers, **kwargs)
118 return _Response(response, data)
119 # httplib2 should catch the lower http error, this is a bug and

E:\anaconda\lib\site-packages\httplib2_init_.py in request(self, uri, method, body, headers, redirections, connection_type)
1992 headers,
1993 redirections,
-> 1994 cachekey,
1995 )
1996 except Exception as e:

E:\anaconda\lib\site-packages\httplib2_init_.py in _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey)
1649
1650 (response, content) = self._conn_request(
-> 1651 conn, request_uri, method, body, headers
1652 )
1653

E:\anaconda\lib\site-packages\httplib2shim_init_.py in _conn_request(self, conn, request_uri, method, body, headers)
152
153 except Exception as e:
--> 154 raise _map_exception(e)
155
156 return response, content

timeout: timed out

from geemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.