New problem No module named 'intelhex*

sorry to ask again. while my ELECROW Display works fine now.

I have the next problem with the CAM Project

## rocessing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html
PLATFORM: Espressif 32 (6.12.0) > AI Thinker ESP32-CAM
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

* framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
* tool-esptoolpy @ 2.40900.250804 (4.9.0)
* toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
  LDF: Library Dependency Finder → https://bit.ly/configure-pio-ldf
  LDF Modes: Finder \~ chain, Compatibility \~ soft
  Found 35 compatible libraries
  Scanning dependencies…
  Dependency Graph
  |-- ArduinoWebsockets @ 0.5.4
  |-- FS @ 2.0.0
  |-- SD_MMC @ 2.0.0
  |-- WiFi @ 2.0.0
  Building in release mode
  Compiling .pio/build/esp32cam/src/main.cpp.o
  Linking .pio/build/esp32cam/firmware.elf
  Retrieving maximum program size .pio/build/esp32cam/firmware.elf
  Checking size .pio/build/esp32cam/firmware.elf
  Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
  RAM:   \[==        \]  15.4% (used 50520 bytes from 327680 bytes)
  Flash: \[===       \]  30.2% (used 949469 bytes from 3145728 bytes)
  Building .pio/build/esp32cam/firmware.bin
  Traceback (most recent call last):
  File “/Users/mk/.platformio/packages/tool-esptoolpy/esptool.py”, line 41, in 
  import esptool
  File “/Users/mk/.platformio/packages/tool-esptoolpy/esptool/**init**.py”, line 42, in 
  from esptool.bin_image import intel_hex_to_bin
  File “/Users/mk/.platformio/packages/tool-esptoolpy/esptool/bin_image.py”, line 16, in 
  from intelhex import HexRecordError, IntelHex
  ModuleNotFoundError: No module named ‘intelhex’
  \*\*\* \[.pio/build/esp32cam/firmware.bin\] Error 1
  ==============================

See

4 Likes

I follow up on this thread.

I have the same problem (intelhex not found) and proceeded as suggested, ‘deleted” (actually renamed directory “tool-esptoolpy” but that didn’t help.

What else can I do?

Deleted and reinstall VScode/PlatformIO?

Reinstalling VSCode or the PlatformIO plugin won’t help here as the problem is located elsewhere.

Please, post your buildlog as shown above.

Do you have any space or other special characters in your username?

Here is the build log:

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (6.12.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
  • tool-esptoolpy @ 2.40900.250804 (4.9.0)
  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 33 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in release mode
    Building .pio/build/esp32dev/bootloader.bin
    Traceback (most recent call last):
    File “/home/fred/.platformio/packages/tool-esptoolpy/esptool.py”, line 41, in
    import esptool
    File “/home/fred/.platformio/packages/tool-esptoolpy/esptool/init.py”, line 42, in
    from esptool.bin_image import intel_hex_to_bin
    File “/home/fred/.platformio/packages/tool-esptoolpy/esptool/bin_image.py”, line 16, in
    from intelhex import HexRecordError, IntelHex
    ModuleNotFoundError: No module named ‘intelhex’
    Compiling .pio/build/esp32dev/FrameworkArduino/FirmwareMSC.cpp.o
    *** [.pio/build/esp32dev/bootloader.bin] Error 1

Thanks for any suggestions.

Some additional thoughts.

Could it be that I (possibly) created a venv for (some of) the projects that now impacting the compile?

I have a directory $HOME/.platformio/penv, possibly I screwed it up while tinkering around.

I post this just to provide as much info as possible.

Thanks

Edit: projects for the Arduino platform compiling fine.

I found the following issue on github https://github.com/platformio/platform-espressif32/issues/1632.

But I’m not seasoned enough to decide on my own what the right step would be to proceed.

Thank You.

The easy way would be to force a reinstallation PlatformIO by deleting the directory %USERPROFILE%\.platformio

Thanks for the tip.

A few questions tho,

  • is it impacting other directories of my (pio) settings?
  • should I remove the extension in VSCode before (or after) the removal of the directory?

Thanks

?

Removing the extension have no effect. Just close VS Code, delete the folder. When you restart VS Code and open a project, PlatformIO will begin to install the missing files automatically.

It might have effect to your projects if you did not specify the platform version in the platformio.ini. Make sure you specify the version you want to use (e.g.: “platform = espressif32 @ 6.12.0”). If no platform version is specified and no platform version is installed, it will install the latest available (which currently is “6.12.0”).

By the way: If you want to use the newer Espressif Arduino Framework 3.x instead of the outdated 2.0.17, take a look at pioarduino’s espressif32 platform.

Thanks for the suggestion.

I did as suggested.

Opened an existing project and did a build of the project.

I received the following message:

Executing task: platformio run

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)

Tool Manager: Installing platformio/tool-esptoolpy @ ~2.40900.0
Unpacking [####################################] 100%
/home/fred/.platformio/penv/bin/python: No module named pip

Please ensure that the following packages are installed:

sudo apt install python3-dev libffi-dev libssl-dev

Cleaning…
Tool Manager: tool-esptoolpy@2.40900.250804 has been installed!
MissingPackageManifestError: Could not find one of ‘package.json’ manifest files in the package

  • The terminal process “platformio ‘run’” terminated with exit code: 1.
  • Terminal will be reused by tasks, press any key to close it.

I than executed sudo apt install …. in $HOME and tried it again with the same result (see build log).

I than switched to .platformio/penvand executed the sudo apt install again without any further success.

Any idea how I can fix that?

Thanks again.

Ah, you’re on linux! Did you install python3-venv? (sudo apt install python3-venv)

Scratching my head a little bit.

I’m not sure whether I grasp the whole story with PIO and phyton venv

To answer your question: No, I do not have python3-venv (system wide) installed.

However, I found a directory pvenv located in $HOME/.platformio.

There is pyvenv.cfg which is pointing to $HOME/.local/share/uv/python/cpython-3.13.11-linux-x86_64-gnu/bin (home=….).

So it seems to me that I have a venv installed for platformio.

As I understand from reading, I have to activate the venv through the command source …./bin/activatewhich would be in my case source $HOME/.platformio/penv .

(Please correct me if I’m wrong).

That’s leads me to the question: how can I easily activate the venv when start working on pio projects?

Can I perhaps automate that in Platformio with some configuration or do I have to use the command on a CLI?

If I can resolve this mystery with venv, perhaps I can resolve all my problems when compiling.

Any suggestion is much appreciated.

TIA

Note: Everything refers to Linux Mint v22.2

Does perhaps a tutorial to the subject pio & python venv exist somewhere?

Unfortunately, I cannot answer your questions as I lack the necessary background knowledge myself. However, I do know that I need to install python3-venv if I want to use PlatformIO on Ubuntu (WSL).

Still hoping someone can answer my question re. venv for PlatformIO.

e.g.

  • Could I possibly setup a venv for each workspace I’m using?
  • Do I have to start the venv before I’m launching pio or can I do that after I launched it?

In the meantime I will tinker with it to find hopefully a solution.

Thanks sivar2311

sivar2311: Linux Mint is based on Ubuntu.

and I just installed python3-venv. It was missing.

You don’t need to setup or start someting. Just installing python3-venv should be enough.

Does it work?

The solution for me is simple: go to C:\Users\<user>\.platformio\penv\Scripts. Open a shell and type: pip3.exe install intelhex. The problem is solved.

1 Like

The solution for me is simple: go to C:\Users\<user>\.platformio\penv\Scripts. Open a shell and type: pip3.exe install intelhex. The problem is solved.

This is the solution for me as well! Many thanks!!!