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

missing charset_normalizer dependency #2505

Closed
2 tasks done
KellyP5 opened this issue Dec 6, 2023 · 3 comments · Fixed by #2506
Closed
2 tasks done

missing charset_normalizer dependency #2505

KellyP5 opened this issue Dec 6, 2023 · 3 comments · Fixed by #2506
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it

Comments

@KellyP5
Copy link
Contributor

KellyP5 commented Dec 6, 2023

Prerequisites

Description

It appears that d4d92dc introduced charset_normalizer as a dependency without explciitely including it in https://github.com/locustio/locust/blob/master/pyproject.toml

This means on import if you are using locust library but don't have charset_normalizer installed you will end up with:

[2023-12-06T16:04:04.623Z] ImportError while loading conftest '/workarea/locust_tests/conftest.py'.
[2023-12-06T16:04:04.623Z] locust_tests/conftest.py:1: in <module>
[2023-12-06T16:04:04.623Z]     import locust
[2023-12-06T16:04:04.623Z] /opt/bb/lib/python3.8/site-packages/locust/__init__.py:22: in <module>
[2023-12-06T16:04:04.623Z]     from .contrib.fasthttp import FastHttpUser
[2023-12-06T16:04:04.623Z] /opt/bb/lib/python3.8/site-packages/locust/contrib/fasthttp.py:27: in <module>
[2023-12-06T16:04:04.623Z]     from charset_normalizer import detect
[2023-12-06T16:04:04.623Z] E   ModuleNotFoundError: No module named 'charset_normalizer'

Command line

locust -f mylocustfile.py -t 10s --headless

Locustfile contents

Import from fasthttp after installing latest locust

Python version

3.11

Locust version

2.19.1

Operating system

Linux 7

@cyberw
Copy link
Collaborator

cyberw commented Dec 8, 2023

charset-normalizer is a dependency of requests, so this shouldnt be necessary. Are you sure you didnt just have a broken install somehow?

@cyberw cyberw added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Dec 8, 2023
@lfoppiano
Copy link

Hi, I've just got the same issue here. I was updating from an older version.

There is a dependency called 'charset-normalizer' which is missing. Perhaps on new installation, this does not happen, but I would add it in the requirements.txt just in case.

@cyberw
Copy link
Collaborator

cyberw commented Dec 18, 2023

Perhaps it is an issue with older versions of requests. Since multiple people seem to have the issue I have merged the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants