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

[BUG] "error: metadata-generation-failed" when installing smolagents[transformers] #940

Open
dereklei opened this issue Mar 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@dereklei
Copy link

Describe the bug
Running "pip install smolagents[transformers]" on my mac failed. The error I received was "error: metadata-generation-failed" ... debugging found error is triggered when trying to build install the "accelerate" package.

I have fixed the problem by installing smolagents[torch] first, then smolagents[transformers]. So I propose to update smolagents pyproject.toml to install these dependencies in such order. I'm making a PR with such proposal for your review.

I'm running in a newly python virtual environment using venv. Python version 3.13. MacOS Sequoia 15.3.1.

Code to reproduce the error
Steps to reproduce:
0. Make sure your don't have Pytorch installed globally

  1. Start with a new Python virtual environment
  2. Install smolagents[all] (ie. pip install smolagents[all])
  3. You should see the error come up when trying to insteall "accelerate" python package

Error logs (if any)
(ai_agent) MacBook-Pro-8:~ USER$ pip install smolagents[transformers]
Requirement already satisfied: smolagents[transformers] in ./.python_venv/ai_agent/lib/python3.13/site-packages (1.10.0)
....[redacted for conciseness]...
Collecting accelerate (from smolagents[transformers])
Using cached accelerate-1.4.0-py3-none-any.whl.metadata (19 kB)
Collecting transformers<4.49.0,>=4.0.0 (from smolagents[transformers])
Using cached transformers-4.48.3-py3-none-any.whl.metadata (44 kB)
....[redacted for conciseness]...
INFO: pip is looking at multiple versions of accelerate to determine which version is compatible with other requirements. This could take a while.
Collecting accelerate (from smolagents[transformers])
Using cached accelerate-1.3.0-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-1.2.1-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-1.2.0-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-1.1.1-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-1.1.0-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-1.0.1-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-1.0.0-py3-none-any.whl.metadata (19 kB)
INFO: pip is still looking at multiple versions of accelerate to determine which version is compatible with other requirements. This could take a while.
Using cached accelerate-0.34.2-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-0.34.1-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-0.34.0-py3-none-any.whl.metadata (19 kB)
Using cached accelerate-0.33.0-py3-none-any.whl.metadata (18 kB)
Collecting numpy>=1.26.0 (from pandas>=2.2.3->smolagents[transformers])
Using cached numpy-1.26.4.tar.gz (15.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [342 lines of output]
....[redacted for conciseness]...

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

Expected behavior
I expect smolagents[all] and smolagents[transformers] to install successfully.

Packages version:
smolagents==1.3.0

Additional context
I'm running in a newly python virtual environment using venv. Python version 3.13. MacOS Sequoia 15.3.1.

I have found a potential solution by switching the order of package installations in pyproject.toml. I'll open a PR for your consideration.

@dereklei dereklei added the bug Something isn't working label Mar 11, 2025
dereklei added a commit to dereklei/smolagents that referenced this issue Mar 11, 2025
Aim to fix bug where failure to install "smolagents[all]" and "smolagents[transformers]" are triggered by not having PyTorch installed first in a new python environment.

See huggingface#940 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant