Ar_08122020
Ar_08122020

Reputation: 31

bq command not found

I am currently working on windows machine. Installed WSL to be able to work in Linux env.

Installed the Google Cloud SDK and am able to run gsutil and gcloud commands. However, while trying to run bq, I get the bq command not found error.

Can someone help me here?

Upvotes: 1

Views: 5284

Answers (3)

smoore4
smoore4

Reputation: 4866

In WSL2, install the Google Cloud CLI with this command as shown in the documentation.

curl https://sdk.cloud.google.com | bash

Then restart your WSL installation. The bq command works at both a Windows command prompt and a WSL terminal.

Upvotes: 0

nReyna
nReyna

Reputation: 21

I've run into a similar issue when working on a Windows environment. I have found that calling bq.cmd helps to get the BigQuery commands to execute.

So running: bq.cmd ls instead of running: bq ls

To list datasets in your current project.

Upvotes: 2

Gourav B
Gourav B

Reputation: 972

"bq" is one of the default Cloud SDK components, and gets installed by default.

Please check with the command "gcloud components list" to confirm if "bq" is available.

If not, maybe somehow your installation got corrupted. Please try re-installing to fix this issue.

Otherwise, try running these commands, see how the path for all are set and same like "/usr/bin" in the given example. This may reveal some path setting related issues which need to be fixed.

Upvotes: 1

Related Questions