Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can I not create a wheel in python?

Here are the commands I am running:

$ python setup.py bdist_wheel usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]    or: setup.py --help [cmd1 cmd2 ...]    or: setup.py --help-commands    or: setup.py cmd --help  error: invalid command 'bdist_wheel'  $ pip --version pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4)  $ python -c "import setuptools; print(setuptools.__version__)" 2.1  $ python --version Python 3.4.1  $ which python /usr/local/bin/python 

Also, I am running a mac with homebrewed python

Here is my setup.py script: https://gist.github.com/cloudformdesign/4791c46fe7cd52eb61cd

I'm going absolutely crazy -- I can't figure out why this wouldn't be working.

like image 291
vitiral Avatar asked Oct 30 '14 22:10

vitiral


People also ask

What is failed building wheel?

Failed building wheel for mysqlclient Running setup.py clean for mysqlclient Failed to build mysqlclient. In Python, a wheel is a package format that contains the instruction for the Python version and platforms supported by the package, as well as the package you wish to install that's already built.

What is a wheel file in Python?

What Is a Python Wheel? A Python . whl file is essentially a ZIP ( . zip ) archive with a specially crafted filename that tells installers what Python versions and platforms the wheel will support. A wheel is a type of built distribution.

How do I create a wheel in Python?

You don't need to write anything special in your setup.py to be able to create a wheel. As long as your setup.py is using setuptools (which it should be anyway), you just write a normal setup.py, install the wheel package on your system, and run python setup.py bdist_wheel.

Why can’t I install wheel in my Python virtualenv?

Your virtualenv does not include wheel, so you’ll have to install wheel again: Once that is installed, we can install our wheel with the following command: To test that this worked, run Python from the Scripts folder in your virtualenv and try importing unidecode.

What is a Python wheel and why should you care?

If you’ve installed a Python package using pip, then chances are that a wheel has made the installation faster and more efficient. Wheels are a component of the Python ecosystem that helps to make package installs just work. They allow for faster installations and more stability in the package distribution process.

Why packaging Python code in wheel files?

There are many benefits to packaging python code in wheel files including their smaller size than source distributions therefore they can move across networks faster. Additionally, installing wheel files directly avoids the step of having to build packages from the source distribution and do not require the need for a compiler.


1 Answers

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...".

like image 193
Thomas Orozco Avatar answered Oct 19 '22 21:10

Thomas Orozco