Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which sqlfluff command not showing executable path

I want to use the sqlfluff extension (extentsion id dorzey.vscode-sqlfluff) in vs code. When I save a sql file I get the following error message in vs code:

"Cannot lint /home/usr/file.sql. The executable was not found. Use the 'Executable Path' setting to configure the location of the executable."

I followed the extensions configuration doecumentation which states:

"The extension expects sqlfluff to be installed and already added to the path. If it is installed but cannot be found, add the path to your preferences as seen below. Find the path by typing which sqlfluff into your terminal."

However, which sqlfluff doesn't print the path in the terminal. Any help is appreciated!

like image 833
Trouble Bucket Avatar asked Jul 18 '26 18:07

Trouble Bucket


2 Answers

To specify a custom path to sqlfluff in VS Code,

  1. Open a command prompt and run python -c "import shutil; print(shutil.which('sqlfluff'))" This will print out the path to your local sqlfluff installation.
  2. Copy the path that is printed out. It should end in "sqlfluff.EXE"
  3. In VS Code, click File --> Preferences --> Settings
  4. Find the setting for "Sqlfluff: Executable Path". Paste the path there.
like image 59
James Apple Avatar answered Jul 23 '26 01:07

James Apple


vscode-sqlfluff does not install sqlfluff itself. You have to install it by yourself.

Follow sqlfluff installation guide

like image 29
Szymon Nieradka Avatar answered Jul 23 '26 01:07

Szymon Nieradka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!