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

ModuleNotFoundError: No module named 'wheel' #750

Closed
yungwine opened this issue Mar 2, 2024 · 3 comments
Closed

ModuleNotFoundError: No module named 'wheel' #750

yungwine opened this issue Mar 2, 2024 · 3 comments

Comments

@yungwine
Copy link

yungwine commented Mar 2, 2024

After

 pip install wheel build
 python -m build --wheel --sdist

I get an error

...
ModuleNotFoundError: No module named 'wheel'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist

but if I downgrade build version to 1.0.3 the error goes away

@layday
Copy link
Member

layday commented Mar 2, 2024

You're building with isolation so the wheel package from the outer environment would not be importable. Can you share more information about the project you are trying to build?

It looks as though you might've had an implicit dependency on wheel when building your sdist. #716 removed wheel from the build-system table fallback. If you'd like to continue depending on wheel for your sdists, you are gonna need to provide a build-system. In your pyproject.toml:

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "wheel"]

@yungwine yungwine closed this as completed Mar 2, 2024
@henryiii
Copy link
Contributor

henryiii commented Mar 2, 2024

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

Is fine. setuptools.build_meta will request wheel if it needs it.

I’m guessing we no longer build pure setup.py packages, then?

@henryiii
Copy link
Contributor

henryiii commented Mar 2, 2024

Ahh, you needed wheel for get_requires_for_build_sdist, okay, that’s why you need wheel. I’d recommend not importing wheel in setup.py, it does not consider its interface public. But okay, that’s to be expected then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants