ESP32-S3 toolchain and idf_tools.py installation fails on MacBook M4 (Apple Silicon, ARM64)
pdo59 opened this issue · 9 comments
PROBLEM DESCRIPTION
On my MacBook M4 (Apple Silicon, ARM64), the ESP32-S3 toolchain and idf_tools.py installation fail when using the Waveshare PlatformIO platform. The same project works perfectly on my Intel iMac. Compilation cannot proceed because the toolchain is not installed and xtensa-esp32s3-elf-gcc is not found.
TO REPRODUCE
- Create a PlatformIO project for ESP32-S3 using:
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip board = ESP32-S3-Touch-LCD-7B framework = arduino - Run
pio runorpio pkg installin the project directory.
EXPECTED BEHAVIOUR
The toolchain and all dependencies should install and compile successfully on Apple Silicon Macs, as they do on Intel Macs.
SCREENSHOTS
Error messages:
idf_tools.py installation failed
error: .../tool-esptoolpy does not appear to be a Python project, as neither pyproject.toml nor setup.py are present in the directory
sh: xtensa-esp32s3-elf-gcc: command not found
ADDITIONAL CONTEXT
- MacBook M4 (Apple Silicon, ARM64), macOS Sequoia 15.6.1
- Python 3.11.7, pip 25.2, PlatformIO Core 6.1.18·Home 3.4.4
- The official PlatformIO ESP32 platform (
platform = espressif32) installs the toolchain correctly, but I need to use the Waveshare platform for my board. - I have tried cleaning
.platformio, updating Python and pip, and reinstalling PlatformIO, but the issue persists. - The same setup works on my Intel iMac.
(Please, remember to close the issue when the problem has been addressed)
it does work since i am developing on a Mac M3. Close VSC delete hidden folder .platformio and start VSC
You can try branch develop too with:
https://github.com/pioarduino/platform-espressif32.git#develop
Btw. pioarduino Platform espressif32 is not comparable with Platformio espressif32. It is like comparing dogs and cats.
It is irrelevant if something works or not in Platformio espressif32
I also had this same error on one of my 2x Apple Silicon devices, and deleting the ~/.platformio folder and a restart didn't resolve it. For some reason, switching to the develop branch resolved the error, and then I could switch back to 55.03.30-2 with no issues
Branch develop has some changes to fix edge cases which can make issues. This changes will be in next release. Thx for confirming that this changes does help. I couldn't reproduce the issues, so the changes are are done on assumptions what can maybe make troubles.
I'm having the same problem. However, when trying switch to a newer version than 54.03.21, I'm shown
Resolving complete dependencies... ERROR: Python's lzma module is unavailable or broken in this interpreter. LZMA (liblzma) support is required for tool/toolchain installation. Please install Python built with LZMA support.
Python version: 3.11.7-final.0
Isn't python installed automatically by platformio? How can I install a version with LZMa supprt?
Thanks in advance.
@biologist79 Assuming MacOS, google for installing brew install Python with brew. When done delete the hidden folder .platformio Now the Python installed from brew will be used for setting up Platformio
@Jason2866 Thanks for your answer!
Yes, it's Mac OS. Sorry, forgot to mention.
Is brew necessary? Just asking because Macports is already running with having python 3.13.7 in place (/opt/local/bin/python3).
No MacPorts is fine. Make sure the MacPorts Python is in Path so that the Platformio Installer does find.
Maybe it is enough to install the xz package.
Updated pioarduino VSC extension to v1.1.0. The plugin installs now Python from https://github.com/astral-sh/python-build-standalone when use inbuilt Python in settings is checked (default).
I've just encountered this issue on an amd64 Linux host. The install fails with
error: /home/myname/.platformio/packages/tool-esptoolpy does not appear to be a Python project, as neither `pyproject.toml` nor `setup.py` are present in the directory
Error: Failed to install esptool from /home/myname/.platformio/packages/tool-esptoolpy (exit 2)
I tried to understand what is going wrong, even installing the develop version of the platform, but nothing helped.