尝试在Windows 10上为所有用户安装Google Cloud SDK(Python)。得到以下错误。
这是新机器并开始新鲜建设。在此之前安装了python 2.7版本。
请帮我解决这个问题。
输出文件夹:C:\ Program Files(x86)\ Google \ Cloud SDK正在下载 Google Cloud SDK核心。提取Google Cloud SDK核心。创建Google Cloud SDK bat文件:C:\ Program Files(x86)\ Google \ Cloud SDK \ cloud_env.bat安装组件。欢迎使用Google Cloud SDK!这将安装所需的所有核心命令行工具 使用Google云端平台。追溯(最近的电话 最后):文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ bin \ bootstrapping \ install.py",第214行,in main()文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ bin \ bootstrapping \ install.py",第192行,主要 安装(pargs.override_components,pargs.additional_components)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ bin \ bootstrapping \ install.py",第134行,in 安装 InstallOrUpdateComponents(to_install,update = update)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ bin \ bootstrapping \ install.py",第177行,in InstallOrUpdateComponents [' - 安静','组件',动词,' - 允许 - 不备份'] + component_ids)文件" C:\ Program文件(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ calliope \ cli.py",第813行, 执行 self._HandleAllErrors(exc,command_path_string,specified_arg_names)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ calliope \ cli.py",第787行,在 执行 resources = args.calliope_command.Run(cli = self,args = args)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ calliope \ backend.py",line 754,在Run中 resources = command_instance.Run(args)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ surface \ components \ update.py",第99行,in 跑 version = args.version)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ core \ updater \ update_manager.py", 第850行,在更新中 command_path =' components.update')文件" C:\ Program Files(x86)\ Google \ Cloud SDK \谷歌云-SDK \ lib中\ googlecloudsdk \芯\更新\ update_manager.py&#34 ;, 第591行,在_GetStateAndDiff中 command_path = command_path)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \谷歌云-SDK \ lib中\ googlecloudsdk \芯\更新\ update_manager.py&#34 ;, 第574行,在_GetLatestSnapshot中 * effective_url.split(','),command_path = command_path)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \谷歌云-SDK \ lib中\ googlecloudsdk \芯\更新\ snapshots.py&#34 ;, 第165行,FromURLs for url in urls] File" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ core \ updater \ snapshots.py", 第186行,在_DictFromURL中 response = installers.ComponentInstaller.MakeRequest(url,command_path)File" C:\ Program Files(x86)\ Google \ Cloud SDK \谷歌云-SDK \ lib中\ googlecloudsdk \芯\更新\ installers.py&#34 ;, 第285行,在MakeRequest中 返回ComponentInstaller._RawRequest(req,timeout = timeout)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \谷歌云-SDK \ lib中\ googlecloudsdk \芯\更新\ installers.py&#34 ;, 第_ 329行,在_RawRequest中 should_retry_if = RetryIf,sleep_ms = 500)文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ core \ util \ retry.py",第155行, 在TryFunc中 return func(* args, kwargs),无文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ core \ url_opener.py",第73行, 在urlopen return opener.open(req,data,timeout)File" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ urllib2.py", 第429行,公开 response = self._open(req,data)File" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ urllib2.py", 第447行,在_open ' _open',req)文件" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ urllib2.py", 第407行,在_call_chain中 result = func(* args)File" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ googlecloudsdk \ core \ url_opener.py",第58行, 在https_open return self.do_open(build,req)File" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ urllib2.py", 第1195行,在do_open中 h.request(req.get_method(),req.get_selector(),req.data,headers)文件 " C:\用户\ cpa8161 \应用程序数据\本地\ TEMP \ tmpxcdivh \蟒\ lib中\ httplib.py&#34 ;, 第1042行,请求中 self._send_request(方法,网址,正文,标题)文件" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ httplib.py", 第1082行,在_send_request中 self.endheaders(body)文件" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ httplib.py", 第1038行,在终结者中 self._send_output(message_body)文件" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ httplib.py", 第882行,在_send_output中 self.send(msg)文件" c:\ users \ cpa8161 \ appdata \ local \ temp \ tmpxcdivh \ python \ lib \ httplib.py", 第844行,发送 self.connect()文件" C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ lib \ third_party \ httplib2__init __。py",第1081行, 在连接 提出SSLHandshakeError(e) ** httplib2.SSLHandshakeError:[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败(_ssl.c:661)安装失败。
答案 0 :(得分:4)
您是否正在执行命令' gcloud init '?如果您在安装时遇到此问题则会有所不同。我直接下载了 gcloud 存档并解压缩,而不是使用需要我代理后面额外权限的安装程序。
我支持公司代理。 执行该命令时出现以下错误
Rechecking network connection...done.
ERROR: Reachability Check still does not pass.
Cannot reach https://www.google.com (SSLHandshakeError)
Cannot reach https://accounts.google.com (SSLHandshakeError)
我遵循了这个程序。这也可能对你有帮助。
答案 1 :(得分:1)
此错误已在Google Issue Tracker上报告。
此问题是由公司代理背后引起的。目前,建议的解决方法detailed here是将公司证书附加到google-cloud-sdk / lib / third_party / httplib2 / cacerts.txt
答案 2 :(得分:1)
需要在..\google-cloud-sdk\lib\third_party\httplib2\cacerts.txt
文件中添加以下证书。然后再次运行install.bat
----BEGIN CERTIFICATE-----\nMIIDJjCCAg6gAwIBAgIIYkBXvgY381UwDQYJKoZIhvcNAQEFBQAwNjE0MDIGA1UE\nAxMrZmVkZXJhdGVkLXNpZ25vbi5zeXN0ZW0uZ3NlcnZpY2VhY2NvdW50LmNvbTAe\nFw0xNzEwMTkxMTQzMzRaFw0xNzEwMjIxMjEzMzRaMDYxNDAyBgNVBAMTK2ZlZGVy\nYXRlZC1zaWdub24uc3lzdGVtLmdzZXJ2aWNlYWNjb3VudC5jb20wggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC1XYAow1e/aghfiZY7H2DFJIQ61okNrUfo\n3tdNPtxT1Rr2QyA0Zv/lZ3/Z/Daux/Sb1gvLXBuvLkzVYpu8EHmiMvATK7MD+ZXv\nZTeREh2UB4grlcLq4mc9uTkiARNAhBrEBrYwMeFPQlfc7zB5kiRAZHMhijah/CRg\nw8eVPn09xIJhfsytkFeHoVIz7EV1pD4VNqGZD+P80GEAgVfjh++leqOvCso4CP1G\nYtaOpzPfI03XcH1y0+b+sLTXduOitEyEji5h7aHe2nxbY8JRodsZ8kK1i1W8LpFN\nH+wZwHh/De5Zwoz3HE5EXDgYyaxT26ehqHbPaW4lkKgGDpx6oco5AgMBAAGjODA2\nMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMBYGA1UdJQEB/wQMMAoGCCsG\nAQUFBwMCMA0GCSqGSIb3DQEBBQUAA4IBAQANVlLefEJ9qYboQKBq5ADjftFGWTl8\nhshV+dExMSj+dnXwScdvQcfUrqpxYZWtRP7290FjGHq54AtrPeQrYxffWXkb6OaQ\nel9ZX4IEViJbmCrc52ePxMRnEInrWCV8zZVoej5W63dxGf2x4bVF3o+95hD6Q5l/\nLt59MpY3J88S1x0YbNzYI7PgTBzzy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9+5AGsPX\n5OCF/RKPIJDainsOSMwhiY8fNIEaENMp82N7/16woWoD87UDOxbm2Z5Rfe3sQatv\nL002NXs1y19U7QuhC25cxcgUC0ESxdXnmBHoLJo8ou73GNj4UJEppNWzXxaXCXtC\ncLZWPMsSBG0M9WY9/UQ2P3273SajkSKMNrAwZFzUXvuwDreKHS89Qc44/JaFCCCS\nwe+lXMhRfWNeBCgS+xZGKe8dUjHrGD9c3RrKbDRDZ3XuQXZgd5VfL/GgjJTcDAXA\nw1zzXQWX4Y6DcU+YXuCVVdOFtBC5qrhzLsiJxhFu+LTyJxLGihQuMytu\n-----END CERTIFICATE-----
答案 3 :(得分:1)
我只是花了几个小时试图使安装程序运行,以尝试编辑ca cert文件,但是在安装过程中,安装程序一直在擦除目录。为了使捆绑gcloud sdk安装程序能够正常工作,我最终不得不创建环境变量 SSL_CERT_FILE 并设置包含Google CA +我公司的代理CA证书的ca证书文本文件的路径。然后,安装程序运行无问题。似乎python http客户端将env变量用于CA验证。
然后,您需要先运行 gcloud配置集custom_ca_certs_file ,然后再运行 gcloud init
答案 4 :(得分:0)
每次安装程序都会擦除目录,因此您无法通过UI进行安装。
因此,更新文件上的组织RootCA后运行安装程序批处理文件:
C:\Users\<username>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\certifi\ cacert.pem
答案 5 :(得分:0)
我发现,除了上述环境变量之外,您还需要通过创建配置文件来预配置gcloud sdk。我写了一个PS脚本来做到这一点。我已经在多台计算机上成功使用了它。
realsessionkey,anothercookie=itsvalue