When I try to import external library of my project in my locust python file, each time I have the error "ModuleNotFoundError : No module name '...'.
Apparently is not clear but locust is installed and works. I have a task to make REST API call and it's ok. But I need to make some action in the init method coming from external file of my project
Example :
I want to import the method "generateILogsToken" in my locust file from _Global.py file
FILE : getWalletInfoLocust.py
from Phoenix.APIs._Global import generateIlogsToken
from locust import HttpUser, task
class ApiUser(HttpUser):
def __init__(self, environment):
print("__init__" + generateIlogsToken())
super().__init__(environment)
@task
def profile(self):
url = "/restapi/json/v1/resources"
self.client.get(url, verify=False, headers={'AUTHTOKEN': 'xxxxx'})
Error generated with the command locust -f getWalletInfoLocust.py
...
from Phoenix.APIs._Global import generateIlogsToken
ModuleNotFoundError: No module named 'Phoenix'
I have this issue for any method imported from external file of my project. When I'm used behave or other, no isse. It's only with locust.
Thx