idf.py build error: AttributeError: 'NoneType' object has no attribute 'validation_alias' esp32

javier3448
Posts: 1
Joined: Wed Oct 08, 2025 1:55 am

idf.py build error: AttributeError: 'NoneType' object has no attribute 'validation_alias' esp32

Postby javier3448 » Wed Oct 08, 2025 2:23 am

Hello, I’m having trouble installing the ESP-IDF toolchain.

I tried installing ESP-IDF on Ubuntu as described here:
https://docs.espressif.com/projects/esp ... etup.html#

I had a previous version of ESP-IDF installed, but I’m not sure if it ever worked.
To uninstall it, I deleted ~/.espressif and ~/esp/esp-idf.

Exact commands I ran afterward:

Code: Select all

sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
cd ~/esp
git clone -b v5.5.1 --recursive https://github.com/espressif/esp-idf.git
cd esp-idf
./install.sh all
. ~/esp/esp-idf/export.sh
cd ~/Downloads/tmpidf/test
idf.py build
python --version: Python 3.12.3

Complete error message:

Code: Select all

WARNING: Cannot load idf.py extension "component_manager_ext"
Executing action: all (aliases: build)
Running cmake in directory /home/javier/Downloads/tmpidf/test/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/javier/.espressif/python_env/idf5.5_py3.12_env/bin/python -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/javier/Downloads/tmpidf/test"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.43.0") 
-- Minimal build - OFF
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/javier/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/javier/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/javier/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20241119/xtensa-esp-elf/bin/xtensa-esp32-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Could not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32
CMake Error at /home/javier/esp/esp-idf/tools/cmake/build.cmake:629 (message):
  Traceback (most recent call last):

    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "/home/javier/.espressif/python_env/idf5.5_py3.12_env/lib/python3.12/site-packages/idf_component_manager/prepare_components/__main__.py", line 6, in <module>
      main()
    File "/home/javier/.espressif/python_env/idf5.5_py3.12_env/lib/python3.12/site-packages/idf_component_manager/prepare_components/prepare.py", line 88, in main
      setup_logging()
    File "/home/javier/.espressif/python_env/idf5.5_py3.12_env/lib/python3.12/site-packages/idf_component_tools/logging.py", line 106, in setup_logging
      if ComponentManagerSettings().DEBUG_MODE:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/javier/.espressif/python_env/idf5.5_py3.12_env/lib/python3.12/site-packages/pydantic_settings/main.py", line 193, in __init__
      super().__init__(
    File "/home/javier/.espressif/python_env/idf5.5_py3.12_env/lib/python3.12/site-packages/pydantic/main.py", line 250, in __init__
      validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/javier/.espressif/python_env/idf5.5_py3.12_env/lib/python3.12/site-packages/idf_component_tools/environment.py", line 296, in fallback_to_default
      if field.validation_alias:
         ^^^^^^^^^^^^^^^^^^^^^^

  AttributeError: 'NoneType' object has no attribute 'validation_alias'

Call Stack (most recent call first):
  /home/javier/esp/esp-idf/tools/cmake/project.cmake:740 (idf_build_process)
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the /home/javier/Downloads/tmpidf/test/build/log/idf_py_stderr_output_11440 and /home/javier/Downloads/tmpidf/test/build/log/idf_py_stdout_output_11440


Who is online

Users browsing this forum: Amazon [Bot], Qwantbot and 5 guests