Код: Выделить всё
brew install --cask gcloud-cli
...
Error: Failure while executing; `/usr/bin/env /usr/local/share/google-cloud-sdk/bin/gcloud config virtualenv create --python-to-use /usr/local/opt/python@3.13/libexec/bin/python3` exited with 1. Here's the output:
ERROR: gcloud failed to load. You are running gcloud with Python 3.8, which is no longer supported by gcloud.
Install a compatible version of Python 3.10-3.14 and set the CLOUDSDK_PYTHON environment variable to point to it.
If you are still experiencing problems, please reinstall the Google Cloud CLI using the instructions here:
https://cloud.google.com/sdk/docs/install
The gcloud-cli install command even seemed to have found the correct python, with --python-to-use /usr/local/opt/python@3.13/libexec/bin/python3 appearing in the output.
And the environment variables (run before and after the gcloud install) look correct:
Код: Выделить всё
% `which python` --version
Python 3.14.3
% `echo $CLOUDSDK_PYTHON` --version
Python 3.14.3
Полная история отладки / Что я пытался это исправить:
Это была родная версия OSX до установки Brew Python:
Код: Выделить всё
% which python
/usr/bin/python
% python --version
Python 2.7.16
% which python3
/usr/bin/python3
% python3 --version
Python 3.8.2
Код: Выделить всё
% echo $PATH
/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Код: Выделить всё
% which python
/usr/local/opt/python/libexec/bin/python
% python --version
Python 3.14.3
% which python3
/usr/local/bin/python3
% python3 --version
Python 3.14.3
Код: Выделить всё
% cat ~/.zshrc
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
export CLOUDSDK_PYTHON=`which python`
Подробнее здесь: https://stackoverflow.com/questions/798 ... -of-python
Мобильная версия