升级到 OSX Mojave 后 GCP 将无法工作
GCP wont work after upgrading to OSX Mojave
升级到 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;但是没有用。
根据发行说明第 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.pkg
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
然后你需要从 brew 重新安装 python2:
brew reinstall python2
在那之后你可以 brew cask install google-cloud-sdk
它会工作
升级到 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;但是没有用。
根据发行说明第 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.pkg
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
然后你需要从 brew 重新安装 python2:
brew reinstall python2
在那之后你可以 brew cask install google-cloud-sdk
它会工作