Search code examples
macoszsh

zsh: command not found for a python package


I installed a package dicedb-cli on my mac:

$ pip3 install dicedb-cli

I can see it at location:

/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages

But when I try to run command, I get:

zsh: command not found: dice

How to add it to path?

Edit: So I added full path(export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dice") to ~./zshrc. But I still see same issue.


Solution

  • /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dice
    

    Is not a place where pip put the executable, it should be in some bin file, I guess bin file in site-packages.

    Try one of pip3 show dicedb-cli or

    find /Library/Frameworks/Python.framework/Versions/3.12/ -name "dice"
    

    and see which bin it located in. Might also be in usr/local/bin or $HOME/.local/bin/.

    Add the whole bin to path —

    export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.12/bin"
    

    Then source ~/.zshrc and you might need to close and reopen the terminal.