-bash: datalab: command not found

Viewed 1669

I installed the cloud datalab component by running gcloud components install datalab

However, I keep getting the following error from my terminal when attempting to create a datalab instance:
-bash: datalab: command not found

enter image description here

When I run gcloud components list, I get that I have correctly installed datalab as evidenced in the image below: enter image description here

Any idea what could be wrong?

3 Answers

I encountered the same issue, and I was able to fix the issue by reinstalling Google Cloud SDK following this instruction and try again.

Make sure to delete the original gcloud command before reinstalling because it may be installed in a different path.

I use Debian, and gcloud command was originally under /usr/local/bin/gcloud, which had that issue. (I don't remember how I installed the command.) When I followed the instruction, it was installed at /usr/bin/gcloud and it worked fine, though it instructed me to run:

$ sudo apt-get install google-cloud-sdk-datalab

instead of:

$ gcloud components install datalab

I just had this problem and found the following code in my bash profile was pointing to the wrong installation folder (presumably after I decided to update or re-install in a different way than I had done originally), changing to the correct location (find by using gcloud info) fixed it:

\# The next line updates PATH for the Google Cloud SDK.
if [ -f '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc' ]; then source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc'; fi

\# The next line enables shell command completion for gcloud.
if [ -f '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc' ]; then source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc'; fi
Related