my python version
python3 --version
Python 3.6.9
pip3 --version pip
9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
md5-7d75e495edd1df391905d112a2c5225c
Traceback (most recent call last):
File "/usr/local/bin/locust", line 11, in
load_entry_point('locust', 'console_scripts', 'locust')()
File "/locust-task/src/locust/locust/main.py", line 123, in main
docstring, user_classes, shape_class = load_locustfile(locustfile)
File "/locust-task/src/locust/locust/main.py", line 79, in load_locustfile
imported = source.load_module()
File "", line 399, in _check_name_wrapper
File "", line 823, in load_module
File "", line 682, in load_module
File "", line 265, in _load_module_shim
File "", line 684, in _load
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/locust-task/locustfile.py", line 1, in
from locust import HttpLocust, TaskSet, task, InterruptTaskSet
ImportError: cannot import name 'InterruptTaskSet'
can someone help me to resolve it?
The correct command to get locust's version is locust -V (capital V)
If that doesnt help, run it in a different folder where there is no locustfile.
The updates you'll need to make in your locustfile are mentioned here https://docs.locust.io/en/latest/changelog.html#changelog-1-0
Thank you @cyberw version also resolved and other errors also resolved.