'zsh: command not found: pre-commit but package installed [duplicate]

Installed pre-commit successfully using the following command in VSCode:

python3 -m pip install pre-commit --user

but when I try to do the pre-commit install, I get the error message:

zsh: command not found: pre-commit


Solution 1:[1]

Try adding this command to your .zshrc so that it recognizes your .bashrc commands, something similar to yours was happening to me.

[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'

for more information: How can you export your .bashrc to .zshrc?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Steve Matos