zsh:找不到 python 包的命令

问题描述 投票:0回答:1

我在我的 Mac 上安装了一个 dicedb-cli 软件包:

$ pip3 install dicedb-cli

我可以在以下位置看到它:

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

但是当我尝试运行命令时,我得到:

zsh: command not found: dice

如何将其添加到路径中?

编辑:所以我将完整路径(export PATH =“$PATH:/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/dice”)添加到〜./zshrc。但我仍然看到同样的问题。

macos zsh
1个回答
0
投票

我发现 Mac 上的 Python 库可能非常棘手 您需要找到 dicedb 可执行文件,很可能位于:

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

您需要在配置文件中添加路径:

Bash: .bashrc or .bash_profile
Zsh: .zshrc

然后在文件中添加以下内容(替换为dicedb路径)

export PATH="/path/to/dice:$PATH"
© www.soinside.com 2019 - 2024. All rights reserved.