3

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?

Ekaba Bisong
  • 2,918
  • 2
  • 23
  • 38
  • Do you have the script under your sdk root? I can find mine under `~/google/google-cloud-sdk/bin/datalab` – yelsayed Jul 20 '17 at 17:10

3 Answers3

2

Based on the output of gcloud components list you have already installed the datalab command line tool. The binary should be present at this location: $GOGOLE_CLOUD_SDK_INSTALL_DIR/bin/datalab

If running just datalab still does not invoke this binary, then you do not have the Cloud SDK bin directory in your $PATH environment variable.

To confirm this theory, verify if you are able to run datalab by providing its full path.

Example (assuming your Cloud SDK is installed at ~/google-cloud-sdk):

~/google-cloud-sdk/bin/datalab
Tuxdude
  • 47,485
  • 15
  • 109
  • 110
1

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
Hiroshi Ichikawa
  • 616
  • 9
  • 10
0

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
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Graeme
  • 23
  • 1
  • 4