having to keep reentering for gsutil export CLOUDSDK_PYTHON=/usr/local/bin/python3.12

Hi,

I am having to run

export CLOUDSDK_PYTHON=/usr/local/bin/python3.12

every time I open a Terminal to run gsutil

(macOS Sonoma 14.1.2)

or I get python version warnings

How do I bake this in permanently?

thanks, david

Solved Solved
0 1 228
1 ACCEPTED SOLUTION

Hi @dvh13,

Welcome to Google Cloud Community!

To permanently set the CLOUDSDK_PYTHON environment variable on macOS, add the export command export CLOUDSDK_PYTHON=/usr/local/bin/python3.12 to your shell configuration file (e.g., .bash_profile or .zshrc). Then, source the file or restart Terminal windows for the changes to take effect. This will allow you to run gsutil without manually setting the environment variable each time. Remember to verify the Python path and version, and manage potential conflicts with multiple Python installations if needed.

View solution in original post

1 REPLY 1

Hi @dvh13,

Welcome to Google Cloud Community!

To permanently set the CLOUDSDK_PYTHON environment variable on macOS, add the export command export CLOUDSDK_PYTHON=/usr/local/bin/python3.12 to your shell configuration file (e.g., .bash_profile or .zshrc). Then, source the file or restart Terminal windows for the changes to take effect. This will allow you to run gsutil without manually setting the environment variable each time. Remember to verify the Python path and version, and manage potential conflicts with multiple Python installations if needed.