Closed barakbs1 closed 2 months ago
Your locust version is very old. Please follow the instructions and upgrade to latest before filing bug reports. Also, this seems like a pandas/numpy issue, not Locust?
Hi @cyberw, thank you for your quick answer. Please correct me if I'm wrong, I'm not managing the Locust version as it is set by the official docker image I'm pulling from https://hub.docker.com/r/locustio/locust. Looking into the docker-hub page, it appears this image was updated 2 days ago, so I guess this image is being maintained? Regarding the pandas/numpy, I'm not familiar with what is the correct way to deal with dependencies issues. Nevertheless, please correct me if I'm wrong, doesn't Locust sets itself with dependency versions to use?
Latest release version of locust is 2.29.1, and that is what is in the docker image too. Perhaps your docker has cached an old version? Either do docker docker pull locustio/locust
, or specify an explicit image tag
❯ docker run locustio/locust -V
locust 2.29.1 from /opt/venv/lib/python3.11/site-packages/locust (Python 3.11.9, OpenSSL 3.0.11)
❯ docker run locustio/locust:2.29.1 -V
locust 2.29.1 from /opt/venv/lib/python3.11/site-packages/locust (Python 3.11.9, OpenSSL 3.0.11)
Pandas/numpy is not really part of this project, talk to them if you have issues with that :) Dependencies are typically managed by building your own image based on locustio/locust. https://docs.locust.io/en/stable/running-in-docker.html#use-docker-image-as-a-base-image
Thank you very much for the answer! I guess you are right and docker is using a cached version. I'll try to either clear the cache or run an explicit version. Thank you! I'll update back with the results.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!
Prerequisites
Description
Hi everyone, I seem to have dependencies issue when running Locust's docker image. When trying to execute the test, I get the following error:
Traceback (most recent call last): File "/opt/venv/bin/locust", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/venv/lib/python3.11/site-packages/locust/main.py", line 75, in main docstring, _user_classes, shape_class = load_locustfile(_locustfile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.11/site-packages/locust/util/load_locustfile.py", line 58, in load_locustfile imported = source.load_module() ^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap_external>", line 605, in _check_name_wrapper File "<frozen importlib._bootstrap_external>", line 1120, in load_module File "<frozen importlib._bootstrap_external>", line 945, in load_module File "<frozen importlib._bootstrap>", line 290, in _load_module_shim File "<frozen importlib._bootstrap>", line 721, in _load File "<frozen importlib._bootstrap>", line 690, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/home/locust/tests/test_constant_high_load.py", line 4, in <module> from common.tasks import init_locust_user, register_device, \ File "/home/locust/common/tasks.py", line 12, in <module> import pandas as pd File "/opt/venv/lib/python3.11/site-packages/pandas/__init__.py", line 22, in <module> from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.11/site-packages/pandas/compat/__init__.py", line 25, in <module> from pandas.compat.numpy import ( File "/opt/venv/lib/python3.11/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module> from pandas.util.version import Version File "/opt/venv/lib/python3.11/site-packages/pandas/util/__init__.py", line 2, in <module> from pandas.util._decorators import ( # noqa:F401 File "/opt/venv/lib/python3.11/site-packages/pandas/util/_decorators.py", line 14, in <module> from pandas._libs.properties import cache_readonly File "/opt/venv/lib/python3.11/site-packages/pandas/_libs/__init__.py", line 13, in <module> from pandas._libs.interval import Interval File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
Looking into the issue, i searched around a little bit for answers, and found this post: https://stackoverflow.com/questions/78650222/valueerror-numpy-dtype-size-changed-may-indicate-binary-incompatibility-expec. It assures that there is a compatibility issue between pandas==2.1.1 and numpy==2.0.0. It States that downgrading to numpy==1.26.4 solved the issue.
Finally, looking into the dependencies which were downloaded by Locust I saw the following: Locust run which had the issue:
Downloading numpy-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata Downloading pandas-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Earlier Locust run which didn't had the issue:Downloading pandas-2.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata Downloading numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Command line
locust --headless -u 100 -i 50 -f tests/test.py
Locustfile contents
Python version
3.11
Locust version
2.15.1
Operating system
Don't know