ee安装
- 创建Python虚拟环境
conda create -n ee python=3.7
- 安装ee
pip install earthengine-api
ee激活
在Google Earth Engine(https://code.earthengine.google.com)官网注册账号。
- 将你的代理设置为全局模式,查看你代理所用http和https端口(一个端口)。
- 打开terminal,激活ee所安装的Python虚拟环境。
- 让terminal终端走代理:
export http_proxy=http://127.0.0.1:你的端口
export https_proxy=http://127.0.0.1:你的端口
earthengine authenticate
以上三条命令在同一terminal窗口输入,因为前两条命令是一次性的,只影响当前窗口。
接下来就会跳出浏览器,然后按流程走。将验证码复制到端口,回车后显示:
Successfully saved authorization token.
表示授权成功。
取消代理设置
unset http_proxy
unset https_proxy
或:
export all_proxy=""