Python Locust“locust”不被识别为内部或外部命令、可操作程序或批处理文件

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

我正在使用使用 python 的 locust 包。我正在关注这个教程:

https://docs.locust.io/en/latest/quickstart.html#example-locustfile-py

但是当我在命令行中执行这段代码时;

locust locustfile.py

我收到此错误;

'locust' is not recognized as an internal or external command,
operable program or batch file.

我已经使用pip成功安装了Locust

任何帮助表示感谢! (抱歉英语不好,这不是我的母语)

python python-3.x command-line-interface command-prompt locust
3个回答
2
投票

这可能是设置环境变量 - Python37/脚本位置路径的问题

有类似问题的您可以参考此链接:

无法在windows上安装Locust


0
投票

使用 pip3 安装 Locust 后,我将

C:/Python37/Scripts
附加到 Windows 中的
Path
环境变量中。之后重新启动终端,它解决了我的问题。


0
投票

在 Windows 上,您需要将

%APPDATA%\Python\Python311\Scripts
添加到
PATH
环境变量

© www.soinside.com 2019 - 2024. All rights reserved.