locustio / locust

Write scalable load tests in plain Python 🚗💨
https://locust.cloud
MIT License
25.06k stars 3k forks source link

No module named 'HTTPLocust' #1054

Closed ymakkena closed 5 years ago

ymakkena commented 5 years ago

[2019-07-26 11:06:51,269] VAM008056/ERROR/stderr: Traceback (most recent call last): [2019-07-26 11:06:51,269] VAM008056/ERROR/stderr: File "/usr/local/bin/locust", line 10, in [2019-07-26 11:06:51,269] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,269] VAM008056/ERROR/stderr: sys.exit(main()) [2019-07-26 11:06:51,269] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,269] VAM008056/ERROR/stderr: File "/usr/local/lib/python3.7/site-packages/locust/main.py", line 426, in main [2019-07-26 11:06:51,271] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,271] VAM008056/ERROR/stderr: docstring, locusts = load_locustfile(locustfile) [2019-07-26 11:06:51,271] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,271] VAM008056/ERROR/stderr: File "/usr/local/lib/python3.7/site-packages/locust/main.py", line 393, in load_locustfile [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: imported = import_locustfile(locustfile, path) [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: File "/usr/local/lib/python3.7/site-packages/locust/main.py", line 365, in import_locustfile [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: imported = source.load_module() [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: File "", line 407, in _check_name_wrapper [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: File "", line 907, in load_module [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: File "", line 732, in load_module [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: File "", line 265, in _load_module_shim [2019-07-26 11:06:51,272] VAM008056/ERROR/stderr: File "", line 696, in _load [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: File "", line 677, in _load_unlocked [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: File "", line 728, in exec_module [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: File "", line 219, in _call_with_frames_removed [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: File "/Users/yash.makkena/dev/nf2/core/locust/geosite_ips.py", line 1, in [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: import HTTPLocust, TaskSet, task [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: ModuleNotFoundError [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: : [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr: No module named 'HTTPLocust' [2019-07-26 11:06:51,273] VAM008056/ERROR/stderr:

I'm running Python 3.7.4 from Homebrew and Locust version 0.11.0. Any ideas on why this could be an issue? I've tried it with older versions of python, and I've tried reinstalling locust, but every time I try to run a locustfile I get this issue. Any ideas?

cgoldberg commented 5 years ago

No module named 'HTTPLocust' occurs because there is no such module by that name. It is HttpLocust.

ymakkena commented 5 years ago

Yeah, I realized that soon after. It has the same issue with HttpLocust, though

cgoldberg commented 5 years ago

are you importing from the locust package?

from locust import HttpLocust

ymakkena commented 5 years ago

Yeah I was. But I ended up fixing my issue, I had to delete all my Python 2.7 framework and it's running now. Thank you!