问题描述
使用命令 pip install locust
安装后弹出如下警告:
Installing collected packages: locust
WARNING: The script locust is installed in '/home/xuechao/.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.
Successfully installed locust-2.2.1
原因分析
'/home/xuechao/.local/bin'
未添加到环境变量。
echo 'export PATH=/home/xxx/bin:$PATH' >>~/.bashrc
source ~/.bashrc
注意事项
将 xxx
替换为你的用户名和路径,比如我这里应该替换为 xuecaho/.local