Kubernetes 获取kubectl get nodes命令时出错

Kubernetes 获取kubectl get nodes命令时出错,kubernetes,gcloud,kubectl,Kubernetes,Gcloud,Kubectl,我在运行以下命令时出错。我已经更新了gcloud SDK,但仍然面临相同的错误 kubectl get nodes Unable to connect to the server: error executing access token command "/Users/salayhin/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=exit status 1 output= stderr=Trace

我在运行以下命令时出错。我已经更新了gcloud SDK,但仍然面临相同的错误

kubectl get nodes


Unable to connect to the server: error executing access token command "/Users/salayhin/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=exit status 1 output= stderr=Traceback (most recent call last):
  File "/Users/salayhin/google-cloud-sdk/lib/gcloud.py", line 95, in <module>
    main()
  File "/Users/salayhin/google-cloud-sdk/lib/gcloud.py", line 54, in main
    from googlecloudsdk.core.util import encoding
  File "/Users/salayhin/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
    from googlecloudsdk.core.util import lazy_regex
  File "/Users/salayhin/google-cloud-sdk/lib/googlecloudsdk/core/util/lazy_regex.py", line 25, in <module>
    from googlecloudsdk.core.util import lazy_regex_patterns
ImportError: cannot import name lazy_regex_patterns
kubectl获取节点
无法连接到服务器:执行访问令牌命令“/Users/salayhin/google cloud sdk/bin/gcloud config config helper--format=json”时出错:err=exit status 1 output=stderr=Traceback(最近一次调用):
文件“/Users/salayhin/googlecloudsdk/lib/gcloud.py”,第95行,在
main()
文件“/Users/salayhin/googlecloudsdk/lib/gcloud.py”,第54行,主视图
从googlecloudsdk.core.util导入编码
文件“/Users/salayhin/google cloud sdk/lib/googlecloudsdk/_init__.py”,第23行,在
从googlecloudsdk.core.util导入lazy_regex
文件“/Users/salayhin/googlecloudsdk/lib/googlecloudsdk/core/util/lazy_regex.py”,第25行,在
从googlecloudsdk.core.util导入lazy_regex_模式
ImportError:无法导入名称惰性\u正则表达式\u模式

这似乎只是来自Google Cloud SDK的一个错误,表明您可能在同一目录中丢失了


我建议在您使用的任何系统上重新安装。

不幸的是,我认为这个问题来自Python客户端库,不是来自Google Cloud SDK。请提供您安装了Google Cloud SDK的linux系统的类型?@MdSirajusSalayhin如果有助于解决问题,请将答案标记为已批准?