I want to move google-cloud-sdk.

Asked 1 years ago, Updated 1 years ago, 135 views

Regarding the following environment, I would like to run Google-cloud-sdk.

$python-V
Python 3.6.8:: Anaconda, Inc.
$ conda-V
conda 4.6.8
$ cat/etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"

Python 2.7 is pre-installed on ubuntu, so I thought it would work if I could set the reference to Python 2.7 well.
After installation and initialization, I tested using bigquery and found the following:

ERROR: Python 3 and later is not compatible with the Google Cloud SDK. 
Please use Python version 2.7.x.
If you have a compatible Python interpreter installed, you can use it 
by setting
The CLOUDSDK_PYTHON environment variable to point to it.

So I set the environment variables as follows.

exportCLOUDSDK_PYTHON=/usr/lib/python 2.7

After that, no matter what command you type, you will see permission denied.

$gcloud --version
/home/kyohei/google-cloud-sdk/bin/gcloud:129:exec: 
/usr/lib/python 2.7—Permission denied

I have no idea what to do from here.

Thank you for your cooperation.

python python3 google-cloud python2

2022-09-30 21:39

2 Answers

Install the Google Cloud SDK in a pyenv environment - Qiita

I saw , but I think I need to use pyenv.
What is the current Python version?

python-V should not show 3.6.8.


2022-09-30 21:39

Thank you for your comment.

I had a problem installing pyenv, so I re-installed ubuntu 16.04 to deal with it.If you follow the instructions, you can now use it normally.

Also, it was my misunderstanding, but ubuntu 18.04 does not have python 2.7 installed.


2022-09-30 21:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.