developers.home-assistant icon indicating copy to clipboard operation
developers.home-assistant copied to clipboard

Problems with bdist_wheel when following HA Dev guide

Open matt2005 opened this issue 4 years ago • 5 comments

When building the development environment using https://developers.home-assistant.io/docs/development_environment/#setting-up-virtual-environment

Building wheels for collected packages: pyyaml, distlib
  Running setup.py bdist_wheel for pyyaml ... error
  Complete output from command /mnt/c/Users/daz/core/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-b0wxy1w6/pyyaml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-gx4luy4z --python-tag cp37:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'

Forum post Problems with bdist_wheel when following HA Dev guide

matt2005 avatar Apr 28 '20 21:04 matt2005

This can be fixed by

Clean old Python virtual env

From inside core directory.

rm -Rv venv

Build new virtual env

python3.7 -m venv venv
source venv/bin/activate
pip3 install wheel

Continue dev guide

Now this step below runs without error

script/setup

matt2005 avatar Apr 28 '20 21:04 matt2005

The above fix feel more like a workaround rather than a proper fix. I can submit a PR to update the documentation but I'd prefer to know if the above comment is the correct way to fix it and not a workaround.

matt2005 avatar Apr 28 '20 21:04 matt2005

It looks like that this issue is limited to certain operating systems/platforms. I don't have wheel present in my venv (on x86_64) and script/setup runs fine.

fabaff avatar May 04 '20 09:05 fabaff

This was when running in WSL (Ubuntu) on windows 10. I did a fresh build and setup as per the Developing on windows guide.

matt2005 avatar May 17 '20 22:05 matt2005

I can reproduce this running Ubuntu 20.04 on WSL2.

TomBrien avatar May 18 '20 08:05 TomBrien