Home > Software engineering >  GCP | How to gcloud init in PowerShell
GCP | How to gcloud init in PowerShell

Time:09-29

When running gcloud init on PowerShell, the scripts seems to stop short and won't keep running.

gcloud init

What it shows:

python.exe : Welcome! This command will take you through the configuration of gcloud.
At C:\Users\minh.tran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.ps1:117 char:3
    & "$cloudsdk_python" $run_args_array
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      CategoryInfo          : NotSpecified: (Welcome! This c...tion of gcloud.:String) [], RemoteException
      FullyQualifiedErrorId : NativeCommandError
 
Settings from your current configuration [dev-finops] are:
accessibility:
  screen_reader: 'False'
core:
  account: [email protected]
  disable_usage_reporting: 'True'
  project: prj-d-finops
proxy:
  address: 10.35.2.194
  password: HireR1ght2022!
  port: '8080'
  type: http
  username: corp\minh.tran
Pick configuration to use:
 [1] Re-initialize this configuration [dev-finops] with new settings 
 [2] Create a new configuration
 [3] Switch to and re-initialize existing configuration: [default]

gcloud init running on cloud shell or cmd will return the following and wait for user input:

Welcome! This command will take you through the configuration of gcloud.

Settings from your current configuration [dev-finops] are:
accessibility:
  screen_reader: 'False'
core:
  account: [email protected]
  disable_usage_reporting: 'True'
  project: prj-d-finops
proxy:
  address: 10.35.2.194
  password: HireR1ght2022!
  port: '8080'
  type: http
  username: corp\minh.tran

Pick configuration to use:
 [1] Re-initialize this configuration [dev-finops] with new settings
 [2] Create a new configuration
 [3] Switch to and re-initialize existing configuration: [default]
Please enter your numeric choice:

How do I get gcloud init to run on PowerShell? What issue do I have here?

CodePudding user response:

Please see the below requirement:

Cloud SDK requires Python; supported versions are Python 3 (3.5 to 3.9). By default, the Windows version of Cloud SDK comes bundled with Python 3. To use Cloud SDK, your operating system must be able to run a supported version of Python.

In order to install python 3.9 on windows, just use this installer https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe.

Be sure to close and reopen the powershell prompt after installation in order to load the new PATH where python executable is added.

  • Related