4

升级到 OSX Mojave (Developer beta 2) 后,每次使用 GCP 以及重新安装它时都会出错。

ERROR: gcloud failed to load: No module named zlib
    gcloud_main = _import_gcloud_main()
    import googlecloudsdk.gcloud_main
    from googlecloudsdk.calliope import base
    from googlecloudsdk.calliope import display
    from googlecloudsdk.calliope import display_taps
    from googlecloudsdk.core.resource import resource_printer_base
    from googlecloudsdk.core.resource import resource_projector
    from apitools.base.py import encoding as protorpc_encoding
    from apitools.base.py.base_api import *
    from apitools.base.py import http_wrapper
    import httplib2
    from httplib2.python2.httplib2 import *
    import gzip
    import zlib

我试图通过brew重新安装python和zlib;但它没有用。

4

1 回答 1

5

根据发行说明的第 3 页:https ://download.developer.apple.com/Developer_Tools/Xcode_10_beta_3/Release_Notes_for_Xcode_10_beta_3.pdf ,您首先需要在以下位置安装软件包:/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14。包

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

然后你需要从brew重新安装python2:

brew reinstall python2

之后你可以brew cask install google-cloud-sdk,它会工作

于 2018-07-04T01:22:16.107 回答