2

I did install sqlfluff on my mac with M1 chip using the command; pip3 install sqlfluff==0.7.0. It went through the installation process as expected and I was able to locate .sqlfluff config file at proper location. But when I run the command sqlfluff --verison I am getting following error.

zsh: command not found: sqlfluff

Can I kindly get some help to debug it? thanx

enter image description here

Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96
jay
  • 1,319
  • 6
  • 23
  • 42
  • `echo $PATH` ? `pip3 show --files sqlfluff` ? – phd Dec 14 '21 at 20:45
  • _to debug_ : Track down where you are changing `PATH`, respectively `path`. Find out why the directory needed here is not in the _path_. – user1934428 Dec 15 '21 at 13:11
  • @phd thanx for your suggestions. I did run the commands as you advised. plz see attached screenshot in my original question. Does it mean that I have it installed but I can't access it. – jay Dec 16 '21 at 22:43
  • @jay IWB better to have it in text for easier copy/pasting. Well, you need to add `…/Python/3.8/bin` to `PATH` – phd Dec 16 '21 at 23:57
  • Hi! I have the same problem, did you solve it? – yuoggy Apr 21 '22 at 12:08
  • @phd How can I understand what should I have to add in PATH? – yuoggy Apr 21 '22 at 12:23
  • Did you install into an env? If so, is the env active when you try to run the command? – dmca Apr 30 '22 at 16:27

2 Answers2

0

I had the same issue on an Intel MacBook Pro running macOS Monterey 12.5. After installing sqlfluff with the pip3 install sqlfluff command, I received the following error message:

$ sqlfluff
-bash: sqlfluff: command not found

Solved the problem installing it with brew:

$ brew install sqlfluff

Then,

$ sqlfluff --version
sqlfluff, version 1.2.1

Cheers!

rlaiola
  • 1
  • 1
0

Not sure if this is still relevant, but:

You can install sqlfluff as root

sudo pip install sqlfluff

This way it will be available under /usr/local/bin which is part of $PATH

If you install it as your user (non-root)

pip install sqlfluff

The executable will be available under ~/.local/bin/ which usually is not part of $PATH

In this case you can either add ~/.local/bin/ to $PATH or copy sqlfluff into /usr/bin or /usr/local/bin

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Ranyel
  • 1
  • 1