loopersfr
loopersfr

Reputation: 21

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

I am using locust package which uses python. I am following this tutorial:

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

But when i get to executing this code in command line;

locust locustfile.py

I get this error;

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

I have succesfully installed locust using pip

Any help apperciated! (sorry for bad English it is not my first language)

Upvotes: 1

Views: 7868

Answers (4)

Supun Sandaruwan
Supun Sandaruwan

Reputation: 2418

Adding C:\Program Files\Python313\Scripts folder to the Path does not work for me.

I found another Scripts folder in C:\Users\<User>\AppData\Roaming\Python\Python313\Scripts which exists locust.exe file as below image.

Then I added this path to the User variable section > Path, and then the locust command worked for me.

Locust.exe location

Upvotes: 0

Andrew Petrov
Andrew Petrov

Reputation: 11

On windows, you need to add %APPDATA%\Python\Python311\Scripts to the PATH environment variable

Upvotes: 1

Daniel Contreras
Daniel Contreras

Reputation: 39

After installing locust using pip3 I appended C:/Python37/Scripts to the Path environment variable in windows. Restarted the terminal afterwards and it fixed my problem.

Upvotes: 1

Anuradha Agarwal
Anuradha Agarwal

Reputation: 44

This could be an issue with setting environment variable - Path for Python37/Scripts location

You may refer to this link with a similar issue:

Not able to install locust on windows

Upvotes: 3

Related Questions