GoogleEarthEngine的Python运行环境共享

  • gee的python运行环境,需要运行下面的几个命令,但是第二个安装一直失败,后来发现conda可以安装,于是基于miniconda安装了一个python3.6虚拟环境,并安装了所需要的库。第一个和第三个使用pip安装,第二个使用conda安装。
pip install google-api-python-client
conda install pyCrypto
pip install earthengine-api
from __future__ import print_function
import ee
#import ee.mapclient

ee.Initialize()

# Get a download URL for an image.
image1 = ee.Image('CGIAR/SRTM90_V4')
path = image1.getDownloadUrl({
    'scale': 30,
    'crs': 'EPSG:4326',
    'region': '[[-120, 35], [-119, 35], [-119, 34], [-120, 34]]'
})
print(path)
  • 运行时报错 TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。,后来搜到了很多比如关闭防火墙,修改hosts文件这些,都没用,最后参考https://zhuanlan.zhihu.com/p/50717864解决,方法为在命令行输入,下面的命令,地址为自己的代理地址,需要注意的是这种设置代理方式只能针对当前窗口有效
set http_proxy=http://127.0.0.1:50482
set https_proxy=http://127.0.0.1:50482

在这里插入图片描述

Package                  Version
------------------------ -------------------
cachetools               4.0.0
certifi                  2019.11.28
chardet                  3.0.4
earthengine-api          0.1.210
future                   0.18.2
google-api-core          1.15.0
google-api-python-client 1.7.11
google-auth              1.10.0
google-auth-httplib2     0.0.3
google-cloud-core        1.1.0
google-cloud-storage     1.24.1
google-resumable-media   0.5.0
googleapis-common-protos 1.6.0
httplib2                 0.15.0
idna                     2.8
pip                      19.3.1
protobuf                 3.11.2
pyasn1                   0.4.8
pyasn1-modules           0.2.8
pycrypto                 2.6.1
pytz                     2019.3
requests                 2.22.0
rsa                      4.0
setuptools               44.0.0.post20200106
six                      1.13.0
uritemplate              3.0.1
urllib3                  1.25.7
wheel                    0.33.6
wincertstore             0.2
发布了57 篇原创文章 · 获赞 73 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/weixin_40450867/article/details/103935013