question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locust install issue - M1 Mac

See original GitHub issue

Describe the bug

Installation fails on M1 Mac gevent fails to install

Steps to reproduce

sukh@Sukhchains-Mac-mini Locust % python3 -m venv venv
sukh@Sukhchains-Mac-mini Locust % source venv/bin/activate
(venv) sukh@Sukhchains-Mac-mini Locust % pip3 install locust
Collecting locust
  Using cached locust-2.5.0-py3-none-any.whl (795 kB)
Collecting ConfigArgParse>=1.0
  Using cached ConfigArgParse-1.5.3-py3-none-any.whl (20 kB)
Collecting msgpack>=0.6.2
  Using cached msgpack-1.0.3.tar.gz (123 kB)
Collecting Werkzeug>=2.0.0
  Using cached Werkzeug-2.0.2-py3-none-any.whl (288 kB)
Collecting roundrobin>=0.0.2
  Using cached roundrobin-0.0.2.tar.gz (2.4 kB)
Collecting typing-extensions>=3.7.4.3
  Using cached typing_extensions-4.0.0-py3-none-any.whl (22 kB)
Collecting Flask-BasicAuth>=0.2.0
  Using cached Flask-BasicAuth-0.2.0.tar.gz (16 kB)
Collecting requests>=2.9.1
  Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting flask>=2.0.0
  Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting gevent>=20.9.0
  Using cached gevent-21.8.0.tar.gz (6.2 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/sukh/Documents/Python/Locust/venv/bin/python3 /Users/sukh/Documents/Python/Locust/venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-build-env-96300qvd/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.8.0' wheel 'Cython >= 3.0a9' 'cffi >= 1.12.3 ; platform_python_implementation == '"'"'CPython'"'"'' 'greenlet >= 0.4.17, < 2.0 ; platform_python_implementation == '"'"'CPython'"'"''
       cwd: None
  Complete output (29 lines):
  Collecting setuptools>=40.8.0
    Using cached setuptools-59.4.0-py3-none-any.whl (952 kB)
  Collecting wheel
    Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
  Collecting Cython>=3.0a9
    Using cached Cython-3.0.0a9-py2.py3-none-any.whl (1.1 MB)
  Collecting cffi>=1.12.3
    Using cached cffi-1.15.0.tar.gz (484 kB)
      ERROR: Command errored out with exit status 1:
       command: /Users/sukh/Documents/Python/Locust/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-install-7kyh8j18/cffi/setup.py'"'"'; __file__='"'"'/private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-install-7kyh8j18/cffi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-pip-egg-info-f1xkpk4j
           cwd: /private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-install-7kyh8j18/cffi/
      Complete output (13 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-install-7kyh8j18/cffi/setup.py", line 147, in <module>
          use_pkg_config()
        File "/private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-install-7kyh8j18/cffi/setup.py", line 111, in use_pkg_config
          _ask_pkg_config(include_dirs,       '--cflags-only-I', '-I', sysroot=True)
        File "/private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-install-7kyh8j18/cffi/setup.py", line 23, in _ask_pkg_config
          p = subprocess.Popen([pkg_config, option, 'libffi'],
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 858, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1704, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      NotADirectoryError: [Errno 20] Not a directory: 'pkg-config'
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available.
  You should consider upgrading via the '/Users/sukh/Documents/Python/Locust/venv/bin/python3 -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/sukh/Documents/Python/Locust/venv/bin/python3 /Users/sukh/Documents/Python/Locust/venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/js/7507s78n4_j84zhwv9l_2tzh0000gn/T/pip-build-env-96300qvd/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 40.8.0' wheel 'Cython >= 3.0a9' 'cffi >= 1.12.3 ; platform_python_implementation == '"'"'CPython'"'"'' 'greenlet >= 0.4.17, < 2.0 ; platform_python_implementation == '"'"'CPython'"'"'' Check the logs for full command output.

Environment

  • OS: macOS on M1
  • Python version: 3.8.9

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
mnvumcommented, Dec 13, 2021

I have the same problem. OS: macOS on M1 Python version: 3.11

I dont think that is the same problem? Your logs look look like it fails building greenlet, not cffi? There are no pre-built wheels for python 3.11, and it is not really supported yet.

Either way: Please try installing the respective packages directly and (assuming that fails) file tickets for the respective packages instead.

Thank you for your reply. I have just solved it.

Use Python 3.10

1reaction
Hritik14commented, Dec 13, 2021

I just tried installing locust on my M1 and it installed without any problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to `pip install` locust on M1 MacBook Pro on Monterey ...
It works well with the below packages on my MacBook Pro. [packages] gevent = "==22.8.0" locust = "==2.12.2" [requires] python_version ...
Read more >
Installation — Locust 2.14.0 documentation
Installation ¶. Install Python (3.7 or later). Install the package (check the wiki if the installation fails).
Read more >
locust - Homebrew Formulae
locust. Install command: brew install locust. Scalable user load testing tool written in Python. https://locust.io/. License: MIT.
Read more >
locust - PyPI
Locust is an easy to use, scriptable and scalable performance testing tool. You define the behaviour of your users in regular Python code,...
Read more >
Installation - Taurus
pip install --upgrade bzt. Keep in mind that some additional software can be required depend on the test type (Java, specific Python tools...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found