Skip to main content
 首页 » 编程设计

python之如何将 python 命令行工具添加到我的 PATH

2025年02月15日10oomusou

我使用 pip 安装了命令行工具 awsebcli。

pip install --upgrade --user awsebcli 

如何将它添加到我的 PATH 中,这样我就可以直接输入

eb  

在终端?

文档是这样说的:

Add an export command to your profile script. The following example adds the path represented by LOCAL_PATH to the current PATH variable.

export PATH=LOCAL_PATH:$PATH

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install.html

但我不确定这里的 LOCAL_PATH 是什么?

$ eb --version 
-bash: eb: command not found 

我将它添加到我的 .bash_profile 中,然后获取文件,它仍然无法正常工作,正如您从上面的输出中看到的那样。

请您参考如下方法:

根据文档,这应该适用于 Linux:export PATH=$PATH:/.local/bin。 Here是一些更详细的说明。