Issue with installing transformers with poetry on M1 Mac
Author: unography
Pull request: no

### System Info

Apple M1 Pro, OS: Sonoma 14.2.1
Python: 3.11
Poetry: 1.6.1

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

On a M1 Mac, running `poetry add transformers` gives the following error - 

```
> poetry add transformers
Using version ^4.36.2 for transformers

Updating dependencies
Resolving dependencies... (2.1s)

Package operations: 2 installs, 0 updates, 0 removals

  • Installing flash-attn (2.1.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel
  
  Traceback (most recent call last):
    File "/Users/macuser/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/macuser/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/macuser/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/var/folders/kn/xw570mln5d36vl516r0pxcf40000gn/T/tmp5nx5qcol/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/var/folders/kn/xw570mln5d36vl516r0pxcf40000gn/T/tmp5nx5qcol/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "/var/folders/kn/xw570mln5d36vl516r0pxcf40000gn/T/tmp5nx5qcol/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 480, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "/var/folders/kn/xw570mln5d36vl516r0pxcf40000gn/T/tmp5nx5qcol/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 8, in <module>
  ModuleNotFoundError: No module named 'packaging'
  

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/chef.py:147 in _prepare
      143│ 
      144│                 error = ChefBuildError("\n\n".join(message_parts))
      145│ 
      146│             if error is not None:
    → 147│                 raise error from None
      148│ 
      149│             return path
      150│ 
      151│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with flash-attn (2.1.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "flash-attn (==2.1.0)"'.
```

`pip install transformers` works fine.

### Expected behavior

transformers library being installed

Comments:
Hi @unography, thanks for raising this issue. 

This appears to be a `poetry` releated issue - `transformers` can be successfully installed with `pip`. Did you run `pip wheel --use-pep517 "flash-attn (==2.1.0)"` as recommended by the error message? 

Note, flash-attn is needed if using flash attention for a model. However, it's not required, you can use 'regular' attention for our models, and as such it's not listed as a requirement in our `setup.py`. 

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.