The Python Oracle

Why can I not create a wheel in python?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 3

--

Chapters
00:00 Why Can I Not Create A Wheel In Python?
00:36 Accepted Answer Score 311
00:54 Answer 2 Score 170
01:11 Answer 3 Score 39
01:24 Answer 4 Score 15
01:37 Thank you

--

Full question
https://stackoverflow.com/questions/2666...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pip #setuptools #pythonwheel

#avk47



ACCEPTED ANSWER

Score 311


Install the wheel package first:

pip install wheel

The documentation isn't overly clear on this, but "the wheel project provides a bdist_wheel command for setuptools" actually means "the wheel package...".




ANSWER 2

Score 170


I also ran into the error message invalid command 'bdist_wheel'

It turns out the package setup.py used distutils rather than setuptools. Changing it as follows enabled me to build the wheel.

#from distutils.core import setup
from setuptools import setup



ANSWER 3

Score 39


Update your setuptools, too.

pip install setuptools --upgrade

If that fails too, you could try with additional --force flag.




ANSWER 4

Score 15


I also ran into this all of a sudden, after it had previously worked, and it was because I was inside a virtualenv, and wheel wasn’t installed in the virtualenv.