使用Google凭据激活后,导入ee并初始化会引发错误。下面是我的终端输出
(mycondaEnvironment) spike@lighthouse:~/repos/CoastSat$ earthengine authenticate
Opening the following address in a web browser:
https://accounts.google.com/o/oauth2/auth?client_id=517222506229-vsmmajv00ul0bs7p89v5m89qs8eb9359.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fearthengine+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdevstorage.full_control&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code
Please authorize access to your Earth Engine account, and paste the generated code below. If the web browser does not start, please manually browse the URL above.
Please enter authorization code: 4/rQFEEw7UDpM9fgkBW0D-6gqYbtLMzVHFjW3D8uFGzYgRHAIwGV1kdt8
Successfully saved authorization token.
一旦我正确激活了地球引擎,请打开python,然后尝试导入并初始化,并出现以下错误。
(mycondaEnvironment) spike@lighthouse:~/repos/CoastSat$ python
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ee
>>> ee.Initialize()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/spike/anaconda3/envs/coastsat/lib/python3.7/site-packages/ee/__init__.py", line 105, in Initialize
ApiFunction.initialize()
File "/home/spike/anaconda3/envs/coastsat/lib/python3.7/site-packages/ee/apifunction.py", line 152, in initialize
signatures = data.getAlgorithms()
File "/home/spike/anaconda3/envs/coastsat/lib/python3.7/site-packages/ee/data.py", line 650, in getAlgorithms
return send_('/algorithms', {}, 'GET')
File "/home/spike/anaconda3/envs/coastsat/lib/python3.7/site-packages/ee/data.py", line 1196, in send_
'Server returned HTTP code: %d' % response.status)
ee.ee_exception.EEException: Server returned HTTP code: 404
我尝试删除凭据文件并重新生成,但是最终都放在同一位置。我不确定我还能做什么。任何帮助深表感谢。