GEE windows 环境配置

参照GEE开发大神的一篇文章GEE学习笔记 三十五:windows下配置本地开发环境 - 无形的风的文章 - 知乎

按他的顺序下来还是出了点问题,再整理一下自己遇到的问题。

1、安装Google的 python API 的客户端

pip install google-api-python-client

2、安装鉴权验证依赖库

pip install pyCrypto(我运行后发现之前已经装过了,所以没有实际效果)

3、安装GEE的python库

pip install earthengine-api

4、初始化GEE的API,同时验证你的GEE账户

python -c "import ee; ee.Initialize()"

第一次运行这个命令会得到系统提示的错误信息,因为我们还没有验证我们的GEE账户,所以我们需要运行下面的命令:

扫描二维码关注公众号,回复: 6855878 查看本文章

earthengine authenticate

(没有遇到缺少oauth2client的错误,但是复制过来验证码后连接超时,需要设置梯子为全局模式)

5、运行他的例子报错WinError10060,连接中断

ee.Initialize() 失败

按他说的解决方法失败,用户名是英文的

解决方案:https://www.shicj.top/post/GEE%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AEWinError10060%E9%94%99%E8%AF%AF

# Import the Earth Engine Python Package
import ee

import os

# update the proxy settings
# os.environ['HTTP_PROXY'] = 'my_proxy_id:proxy_port'
# os.environ['HTTPS_PROXY'] = 'my_proxy_id:proxy_port'
os.environ['HTTP_PROXY'] = 'http://127.0.0.1:1080'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:1080'

# Initialize the Earth Engine object, using the authentication credentials.
ee.Initialize()

成功!所以正确解决方法是改一下端口设置,但每次运行都要在前面加上这些代码,梯子的全局和PAC模式都可以。

猜你喜欢

转载自www.cnblogs.com/tccbj/p/11237286.html