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

Can't install locust on M1 Mac #2115

Closed
NitzanShifrin opened this issue Jun 14, 2022 · 10 comments
Closed

Can't install locust on M1 Mac #2115

NitzanShifrin opened this issue Jun 14, 2022 · 10 comments
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it

Comments

@NitzanShifrin
Copy link

Error when installing locust - problem with gevent

Requirement already satisfied: pyzmq>=22.2.1 in /Users/nshifrin/Library/Python/3.8/lib/python/site-packages (from locust->-r BusLoadTest/requirements.txt (line 1)) (22.3.0)
Collecting gevent>=20.12.1
Using cached gevent-21.12.0.tar.gz (6.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1

ImportError: dlopen(/private/var/folders/yt/yzcjd_217bx_jqc12n70kt0m0000gn/T/pip-build-env-fi2yc_2l/overlay/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so, 0x0002): tried: '/private/var/folders/yt/yzcjd_217bx_jqc12n70kt0m0000gn/T/pip-build-env-fi2yc_2l/overlay/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_cffi_backend.cpython-38-darwin.so' (no such file), '/usr/lib/_cffi_backend.cpython-38-darwin.so' (no such file)

Environment

  • OS: Mac Monterey 12.2.1
  • Python version: 3.8
  • Locust version: latest and 2.8.3
  • Locust command line that you ran: pip3 install locust
@cyberw
Copy link
Collaborator

cyberw commented Jun 14, 2022

Sounds like this ticket belongs in gevent instead of Locust (unfortunately I dont even have an Mx mac to test this on, so I wouldnt be of much help anyway)

@NitzanShifrin
Copy link
Author

Sounds like this ticket belongs in gevent instead of Locust (unfortunately I dont even have an Mx mac to test this on, so I wouldnt be of much help anyway)

Hey thanks for reaching out.
There are plenty of tickets over gevent repo, thought you might have a 'hack' to go around it :(

@cyberw
Copy link
Collaborator

cyberw commented Jun 15, 2022

Maybe try using rosetta? https://stackoverflow.com/questions/70723757/arch-x86-64-and-arm64e-is-available-but-python3-is-saying-incompatible-architect

@cyberw cyberw changed the title Can't install locust on Mac Can't install locust on M1 Mac Jul 7, 2022
@cyberw
Copy link
Collaborator

cyberw commented Jul 7, 2022

Looks like a fix is on the way gevent/gevent#1721

@cyberw
Copy link
Collaborator

cyberw commented Aug 27, 2022

Is this still an issue with latest gevent?

@cyberw cyberw added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Sep 2, 2022
@samuelspagl
Copy link
Contributor

@NitzanShifrin I'm using Locust on my M1 Mac. But I am installing everything with pipenv instead of pip. Right know I am not running in any issues.

@github-actions github-actions bot removed the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Sep 6, 2022
@NitzanShifrin
Copy link
Author

hey @cyberw
Installation was completed, but when I try to run a test I get a similar error.

@samuelspagl thanks!
We are not using locust ATM, but if we ever need it again, I'll keep that in mind! thanks for answering!

@cyberw cyberw added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Sep 18, 2022
@mgor
Copy link
Contributor

mgor commented Sep 26, 2022

Sorry for commenting on a stale issue, but I have confirmed that there's no (longer a) problem to install or run locust on an M1 mac, using the "Simple" example from https://locust.io and installed with pip.

➜ uname -a;  locust -f locustfile.py --headless --host http://example.com --run-time 1s; python3 -m pip freeze | grep -E '(locust|gevent)='; python3 --version
Darwin secret 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64
[2022-09-26 18:04:54,166] secret/INFO/locust.main: Run time limit set to 1 seconds
[2022-09-26 18:04:54,166] secret/INFO/locust.main: Starting Locust 2.12.1
Type     Name                                  # reqs      # fails |    Avg     Min     Max    Med |   req/s  failures/s
--------|------------------------------------|-------|-------------|-------|-------|-------|-------|--------|-----------
--------|------------------------------------|-------|-------------|-------|-------|-------|-------|--------|-----------
         Aggregated                                 0     0(0.00%) |      0       0       0      0 |    0.00        0.00

[2022-09-26 18:04:54,167] secret/INFO/locust.runners: Ramping to 1 users at a rate of 1.00 per second
[2022-09-26 18:04:54,167] secret/INFO/locust.runners: All users spawned: {"WebsiteUser": 1} (1 total users)
[2022-09-26 18:04:55,093] secret/INFO/locust.main: --run-time limit reached, shutting down
[2022-09-26 18:04:55,095] secret/INFO/locust.main: Shutting down (exit code 1)
Type     Name                                  # reqs      # fails |    Avg     Min     Max    Med |   req/s  failures/s
--------|------------------------------------|-------|-------------|-------|-------|-------|-------|--------|-----------
GET      /                                          1     0(0.00%) |    104     104     104    104 |    1.43        0.00
POST     /login                                     1   1(100.00%) |    407     407     407    407 |    1.43        1.43
GET      /static/assets.js                          1   1(100.00%) |    183     183     183    183 |    1.43        1.43
--------|------------------------------------|-------|-------------|-------|-------|-------|-------|--------|-----------
         Aggregated                                 3    2(66.67%) |    231     104     407    180 |    4.30        2.87

Response time percentiles (approximated)
Type     Name                                          50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
--------|----------------------------------------|--------|------|------|------|------|------|------|------|------|------|------|------
GET      /                                             100    100    100    100    100    100    100    100    100    100    100      1
POST     /login                                        410    410    410    410    410    410    410    410    410    410    410      1
GET      /static/assets.js                             180    180    180    180    180    180    180    180    180    180    180      1
--------|----------------------------------------|--------|------|------|------|------|------|------|------|------|------|------|------
         Aggregated                                    180    180    410    410    410    410    410    410    410    410    410      3

Error report
# occurrences      Error                                                                                               
------------------|-----------------------------------------------------------------------------------------------------
1                  POST /login: HTTPError('404 Client Error: Not Found for url: http://example.com/login')             
1                  GET /static/assets.js: HTTPError('404 Client Error: Not Found for url: http://example.com/static/assets.js')
------------------|-----------------------------------------------------------------------------------------------------
gevent==21.12.0
locust==2.12.1
Python 3.10.7

@cyberw
Copy link
Collaborator

cyberw commented Sep 26, 2022

Nice!

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

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!

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

No branches or pull requests

4 participants