title: Pytest/Locust: ModuleNotFoundError No module named
body: <p>Ive tried to find anwsers on similar topics, but... nothing helped.<br />
  When I run my regular tests with <code>pytest -m blablabla</code> - there are no problems, but<br />
  when I run locust by command:</p>
  <blockquote>
  <p>locust -f my_locustfiles/instr_performance.py</p>
  </blockquote>
  <p>than got this:</p>
  <pre><code>(venv) evgen@TLL amapitest % locust -f my_locustfiles/instr_performance.py
  Traceback (most recent call last):
    File &quot;/Users/evgen/venv/bin/locust&quot;, line 8, in &lt;module&gt;
      sys.exit(main())
    File &quot;/Users/evgen/venv/lib/python3.10/site-packages/locust/main.py&quot;, line 70, in main
      docstring, _user_classes, shape_class = load_locustfile(_locustfile)
    File &quot;/Users/evgen/venv/lib/python3.10/site-packages/locust/util/load_locustfile.py&quot;, line 58, in load_locustfile
      imported = source.load_module()
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 548, in _check_name_wrapper
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 1063, in load_module
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 888, in load_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 290, in _load_module_shim
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 719, in _load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 688, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 883, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 241, in _call_with_frames_removed
    File &quot;/Users/evgen/PycharmProjects/api-testing/amapitest/my_locustfiles/instr_performance.py&quot;, line 8, in &lt;module&gt;
      from amapitest.src.helpers.jwt_generator import generate_json_web_token
  ModuleNotFoundError: No module named 'amapitest.src.helpers'
  </code></pre>
  <p><strong>my project structure:</strong></p>
  <pre><code>├── amapitest  
  │   ├── my_locustfiles  
  │   │   ├── __init__.py  
  │   │   └── instr_performance.py  
  │   ├── src  
  │   │   ├── configs  
  │   │   ├── dao  
  │   │   ├── helpers  
  │   │   └── utilities  
  │   ├── tests  
  │   └── tmp  
  ├── amapitest.egg-info  
  ├── build  
  ├── dist  
  ├── env.sh  
  ├── requirements.txt  
  └── setup.py  
  </code></pre>
  <p><strong>additional info:</strong><br />
  locust 2.11.0<br />
  pytest 7.1.2<br />
  python 3.10<br />
  macOS monterey</p>