gpt4 book ai didi

macos - 安装google cloud sdk时出现"ImportError: No module named zlib"

转载 作者:行者123 更新时间:2023-12-01 23:17:06 26 4
gpt4 key购买 nike

我正在按照此 documentation 在 mac 上安装 google cloud sdk 。但我在尝试运行此命令时失败了:

$ curl https://sdk.cloud.google.com | bash

这是错误:

Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Users/tran.ba.vinh.son/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/Users/tran.ba.vinh.son/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 44, in <module>
from googlecloudsdk.core.credentials import store as c_store
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py", line 32, in <module>
from googlecloudsdk.core import http
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/googlecloudsdk/core/http.py", line 31, in <module>
from googlecloudsdk.core import http_proxy
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/googlecloudsdk/core/http_proxy.py", line 26, in <module>
import httplib2
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/third_party/httplib2/__init__.py", line 18, in <module>
from httplib2.python2.httplib2 import *
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/third_party/httplib2/python2/httplib2/__init__.py", line 35, in <module>
import gzip
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gzip.py", line 9, in <module>
import zlib
ImportError: No module named zlib

我尝试使用 Homebrew 但同样的错误:

brew cask install google-cloud-sdk

甚至在通过 brew install zlib 安装 zlib 之后。我仍然遇到那个错误。如果您有任何建议,请帮助我,非常感谢!

最佳答案

我找到了这个commenthomebrew core 上为我解决了这个问题。

TL;DR ->sudo installer -pkg/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target/

我在安装 asdf 时也遇到了这个问题。我运行了上面的命令,然后 brew install asdf 工作了。我认为此问题是在 macOS 更新后发生的,因为我必须再次运行它才能安装 google-cloud-sdk

关于macos - 安装google cloud sdk时出现"ImportError: No module named zlib",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54343982/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com