VS Code extension installation error - invalid command 'bdist_wheel'

User avatar
pascalb
Posts: 4
Joined: Sat May 16, 2020 5:42 am

VS Code extension installation error - invalid command 'bdist_wheel'

Postby pascalb » Sat May 16, 2020 6:17 am

Hi,
I'm trying to install VS Code extension. But I get an error:
error: invalid command 'bdist_wheel'
. The log below provides more information about the context:
Installing package Toolchain for Xtensa (ESP32) based on GCC
Installing tar.gz package Toolchain for Xtensa (ESP32) based on GCC
Installing package Toolchain for ESP32 ULP coprocessor
Installing tar.gz package Toolchain for ESP32 ULP coprocessor
Installing package OpenOCD for ESP32
Installing tar.gz package OpenOCD for ESP32
Installing python virtualenv and ESP-IDF python requirements...
Creating a new Python environment in /home/pascalb/.espressif/python_env/idf4.0_py3.6_env ...



Requirement already satisfied: setuptools in ./lib/python3.6/site-packages (from -r /home/pascalb/esp-idf/requirements.txt (line 4))
Collecting click>=5.0 (from -r /home/pascalb/esp-idf/requirements.txt (line 8))
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting pyserial>=3.0 (from -r /home/pascalb/esp-idf/requirements.txt (line 9))
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting future>=0.15.2 (from -r /home/pascalb/esp-idf/requirements.txt (line 10))
Using cached https://files.pythonhosted.org/packages ... 8.2.tar.gz
Collecting cryptography>=2.1.4 (from -r /home/pascalb/esp-idf/requirements.txt (line 11))
Using cached https://files.pythonhosted.org/packages ... x86_64.whl
Collecting pyparsing<2.4.0,>=2.0.3 (from -r /home/pascalb/esp-idf/requirements.txt (line 12))
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting pyelftools>=0.22 (from -r /home/pascalb/esp-idf/requirements.txt (line 13))
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting six>=1.4.1 (from cryptography>=2.1.4->-r /home/pascalb/esp-idf/requirements.txt (line 11))
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography>=2.1.4->-r /home/pascalb/esp-idf/requirements.txt (line 11))
Using cached https://files.pythonhosted.org/packages ... x86_64.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography>=2.1.4->-r /home/pascalb/esp-idf/requirements.txt (line 11))
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Building wheels for collected packages: future
Running setup.py bdist_wheel for future: started
Running setup.py bdist_wheel for future: finished with status 'error'
Complete output from command /home/pascalb/.espressif/python_env/idf4.0_py3.6_env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_yb_nody/future/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/tmpgn5_z3rrpip-wheel- --python-tag cp36:
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'

----------------------------------------
Running setup.py clean for future
Failed to build future
About my configuration: I'm using Linux Mint 19.3 (based on Ubuntu 18.04). Python2 and python3 are installed. I provided python3 path to ESP-IDF extension. Before starting the installation of the extension, I installed python-wheel and python3-wheel, and python3-venv (without python3-venv, the installation fails before the above error).

What could I do?

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: VS Code extension installation error - invalid command 'bdist_wheel'

Postby ESP_bignacio » Thu May 28, 2020 2:04 am

It seems venv is not passing wheel to the virtualenv before installing requirements.txt packages. Maybe an old pip version ?

Try `pip install --upgrade pip wheel` and `pip3 install --upgrade pip wheel` and run the extension tools download again please.

User avatar
pascalb
Posts: 4
Joined: Sat May 16, 2020 5:42 am

Re: VS Code extension installation error - invalid command 'bdist_wheel'

Postby pascalb » Mon Jun 01, 2020 6:08 am

I tried to upgrade pip and wheel, but this didn't make the error disappear :-(

I then tried to set python to be python3 and started a new installation from scratch, but it failed. I tried an installation on a working ESP-IDF configuration, but it failed as well. I tried an installation on the latest ubuntu (20.04), but same result: failure :-(

User avatar
pascalb
Posts: 4
Joined: Sat May 16, 2020 5:42 am

Re: VS Code extension installation error - invalid command 'bdist_wheel'

Postby pascalb » Tue Jun 02, 2020 5:02 am

I found a way to make it (almost) work: I built the extension from source code. Note: I set python3 as default python, and I installed python3-dev, python3-wheel and python3-venv beforehand.

Then I tried to build a sample project. I got a message listing a few python dependencies that were not satisfied:

Code: Select all

click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
...
you can run "/usr/bin/python -m pip install --user -r /home/pascalb/esp-idf/requirements.txt" for resolving the issue.
I ran the proposed command, to install them.

This allowed me to build, flash and monitor. But when I tried debugging, I got the following error:

Code: Select all

Traceback (most recent call last):
  File "/home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/debug_adapter_main.py", line 26, in <module>
    from debug_adapter import cli
  File "/home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/debug_adapter/__init__.py", line 25, in <module>
    from .debug_adapter import DebugAdapter, DaArgs, A2VSC_READY2CONNECT_STRING, A2VSC_STOPPED_STRING, A2VSC_STARTED_STRING
  File "/home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/debug_adapter/debug_adapter.py", line 35, in <module>
    from . import debug_backend as dbg
  File "/home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/debug_adapter/debug_backend/__init__.py", line 1, in <module>
    from .debug_backend import *
  File "/home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/debug_adapter/debug_backend/debug_backend/__init__.py", line 3, in <module>
    from .gdb import Gdb
  File "/home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/debug_adapter/debug_backend/debug_backend/gdb.py", line 8, in <module>
    from pygdbmi.gdbcontroller import GdbController
ModuleNotFoundError: No module named 'pygdbmi'
[Stopped] : ESP-IDF Debug Adapter
I stopped there my attempt, as I was running out of time.

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: VS Code extension installation error - invalid command 'bdist_wheel'

Postby ESP_bignacio » Tue Jun 02, 2020 9:30 am

Hi @pascalb sorry for late reply.

After reviewing on Ubuntu, we found out the issue. It seems venv doesn't include wheel in the virtual environment by default, so when the requirements.txt's packages are being installed it can't find bdist_wheel. This only seems to happen on Ubuntu (maybe also in other linux distributions?)

There is a bug fix in https://github.com/espressif/vscode-esp ... n/pull/113. Sorry for the inconvenience. It should be fixed soon in marketplace and GitHub master.

The second error is because the debug adapter requires some python packages too, which are not installed yet. These are defined in {EXTENSION_DIR}/esp_debug_adapter/requirements.txt. You can try

Code: Select all

python -m pip install --user -r /home/pascalb/Dev/vscode-esp-idf-extension/esp_debug_adapter/requirements.txt

User avatar
pascalb
Posts: 4
Joined: Sat May 16, 2020 5:42 am

Re: VS Code extension installation error - invalid command 'bdist_wheel'

Postby pascalb » Thu Jun 04, 2020 4:31 pm

Thanks for your answer. I'll wait for the merge of the fix.

Who is online

Users browsing this forum: No registered users and 26 guests