Search code examples
python-3.xpython-black

Black python formatter not working in zsh


I use the python formatter Black, but when I switched to zsh it stop working. Every time I try to use it manually through the terminal I get zsh: command not found: black

I have it installed here /Users/HBrovell/Library/Python/3.7/bin/black and added to my .zshrc with export PATH="/Users/HBrovell/Library/Python/3.7/bin/black:$PATH"

What I'm missing here to get it to work?


Solution

  • You don't add black itself to the PATH; you add the directory containing black:

    export PATH="/Users/HBrovell/Library/Python/3.7/bin/:$PATH"