Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run test via locust command line #635

Closed
anhvuong123 opened this issue Jul 26, 2017 · 2 comments
Closed

Can't run test via locust command line #635

anhvuong123 opened this issue Jul 26, 2017 · 2 comments

Comments

@anhvuong123
Copy link

Hi locustio and community,

I'm a newbie in Locust Performance test & very interested in the modern tool Locust.
Via the first round to start, I have just prepared some things but get a error after run locust:

  1. Machine to run Locust Tool: Windows10
  2. Installed Pyhton 3.6.2
  3. Installed pip as the guide from https://pip.pypa.io/en/stable/installing
  4. Installed newest Locust as the guide "pip install locustio" (run from command line)
  5. Prepare the pyhton file with the example code as below:
    from locust import HttpLocust
    from tasks import MyTasks
    class UserBehavior(TaskSet):
    def on_start(self):
    """ on_start is called when a Locust start before any task is scheduled """
    class WebsiteUser(HttpLocust):
    task_set = UserBehavior
    min_wait = 5000
    max_wait = 9000
    host="http://localhost"
  6. I open command line & run via the statement: locust -f "C:\Users\Administrator\Desktop\install Locustio\Example Code\ex1.py"

==> Actual Result: Get error from the current command line:
"Traceback (most recent call last):
File "C:\Program Files (x86)\Python3.6.2\Scripts\locust-script.py", line 11, in
load_entry_point('locustio==0.7.5', 'console_scripts', 'locust')()
File "c:\program files (x86)\python3.6.2\lib\site-packages\pkg_resources_init_.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\program files (x86)\python3.6.2\lib\site-packages\pkg_resources_init_.py", line 2631, in load_entry_point
return ep.load()
File "c:\program files (x86)\python3.6.2\lib\site-packages\pkg_resources_init_.py", line 2291, in load
return self.resolve()
File "c:\program files (x86)\python3.6.2\lib\site-packages\pkg_resources_init_.py", line 2297, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "c:\program files (x86)\python3.6.2\lib\site-packages\locust_init_.py", line 1, in
from core import HttpLocust, Locust, TaskSet, task
ModuleNotFoundError: No module named 'core'
"

Please help me via the case & Let me know if you has a other way to help me start it with the better result.

Many thanks,

@andrewmichaelsmith
Copy link

andrewmichaelsmith commented Jul 26, 2017

I believe this is an issue that has been fixed in the alpha which you must explicitly install:

pip install locustio==0.8a2

See #310

@anhvuong123
Copy link
Author

I have followed as you mention and it can run successfully.

Many thank andrewmichaelsmith,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants