解决pip3安装软件包出现‘The script xxx is installed in ‘/home/xxx/bin‘ which is not on PATH’警告的问题

在使用pip3安装软件包的时候,会出现一个警告错误,比如

python3 -m pip3 install pipenv
> WARNING: The script pipenv is installed in ‘/home/用户名/.local/bin’ which is not on PATH.Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

这时候可以执行以下命令来临时解决:

export PATH=/home/用户名/.local/bin/:$PATH

想要永久解决这一警告错误,就需要将上面的命令写入 ~/.bashrc 或者 ~/.zshrc 中。
bash的用:~/.bashrc
zsh的用:~/.zshrc

echo 'export PATH=/home/用户名/.local/bin/:$PATH' >>~/.bashrc
source ~/.bashrc

此时再用pip3就不会出现警告错误,先前安装的包也可以直接使用了。

《解决pip3安装软件包出现‘The script xxx is installed in ‘/home/xxx/bin‘ which is not on PATH’警告的问题》 作者:whwtf ;固定链接:https://blog.whwtf.com/index.php/20220408105.html
上一篇
下一篇