问题描述
升级到OSX Mojave(Developer beta 2)后,每次使用GCP以及重新安装GCP都会出现错误.
After I upgraded to OSX Mojave (Developer beta 2) I get an error every time I use GCP and also at reinstalling it.
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.但这没用.
I have tried to reinstall python as well as zlib through brew; but it did not work.
推荐答案
发布说明的第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
Per page 3 of the release notes: https://download.developer.apple.com/Developer_Tools/Xcode_10_beta_3/Release_Notes_for_Xcode_10_beta_3.pdf, you first need to install the package at: /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:
Then you need to reinstall python2 from brew:
brew reinstall python2
之后,您可以brew cask install google-cloud-sdk
,它将正常工作
After that you can brew cask install google-cloud-sdk
and it will work
这篇关于升级到OSX Mojave后,GCP无法工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!