I’m using locust 2.29.1
for my performance tests.
It works fine on Python 3.11.8 but now I’m trying to move to Python 3.12.4 and can’t debug because it’s freezing on the line with import locust
. Gevent compatible
in PyCharm settings is checked. And I don’t have any exceptions during script running.
Here is the error output:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/path/to/project/.venv/lib/python3.12/site-packages/locust/__init__.py", line 19, in <module>
from .contrib.fasthttp import FastHttpUser
File "<frozen importlib._bootstrap>", line 471, in _lock_unlock_module
File "<frozen importlib._bootstrap>", line 365, in acquire
KeyboardInterrupt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1551, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"n", file, 'exec'), glob, loc)
File "/path/to/project/src/scripts/locustfile.py", line 3, in <module>
import locust
File "<frozen importlib._bootstrap>", line 1357, in _find_and_load
File "<frozen importlib._bootstrap>", line 421, in __exit__
File "<frozen importlib._bootstrap>", line 376, in release
RuntimeError: cannot release un-acquired lock
python-BaseException
In the locust documentation, I didn’t find any suggestions.