"no module named idf_component_manager" with clion

KallDrexx
Posts: 13
Joined: Sun Jul 30, 2023 6:25 pm

"no module named idf_component_manager" with clion

Postby KallDrexx » Sat Sep 09, 2023 8:16 pm

I'm trying to set up CLion to work with esp-idf's libraries and build system. This was working on one computer but I'm having trouble getting it setup on a different one.

I copied the hello_world directory into a new directory. I set the correct `IDF_PATH` value and set up my `PATH` the same way `export.ps1` does. When I go to load the cmake project the following error occurs:
-- 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
-- Checking Python dependencies...
Python requirements are satisfied.
Constraint file: C:\Users\me\.espressif\espidf.constraints.v5.2.txt
Requirement files:
- C:\Users\me\esp\esp-idf\tools\requirements\requirements.core.txt
Python being checked: C:\Users\me\.espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe
CMake Error at C:/Users/me/esp/esp-idf/tools/cmake/build.cmake:544 (message):
C:\Users\me\AppData\Local\Programs\Python\Python311\python.exe: Error while
finding module specification for 'idf_component_manager.prepare_components'
(ModuleNotFoundError: No module named 'idf_component_manager')

Call Stack (most recent call first):
C:/Users/me/esp/esp-idf/tools/cmake/project.cmake:548 (idf_build_process)
CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
This occurs with the official windows installer, or from installing from a `git clone`.

Any ideas what's missing?

KallDrexx
Posts: 13
Joined: Sun Jul 30, 2023 6:25 pm

Re: "no module named idf_component_manager" with clion

Postby KallDrexx » Wed Sep 13, 2023 2:06 am

I'm still banging my head against the wall for this but getting closer.

It appears that this only happens when using the MSVC toolchain, it does not occur when using mingw toolchain. While that mostly fixes the issue I'm still trying to figure out what the core reason it.

It appears that when using the MSVC toolchain, it's always using the global Python environment and not the Espressif Python environment. That's even if I manually specify `IDF_PYTHON_ENV_PATH` and set the path to the same way as it is on export.

Braklord
Posts: 1
Joined: Thu Feb 15, 2024 11:06 pm

Re: "no module named idf_component_manager" with clion

Postby Braklord » Thu Feb 15, 2024 11:08 pm

A bit too late, but maybe for some further peoples with the same issue.
Activating the Component Manager
If CMake is started using idf.py or ESP-IDF VSCode Extension then the component manager will be activated by default.

If CMake is used directly or with some CMake-based IDE like CLion, it’s necessary to set the IDF_COMPONENT_MANAGER environment variable to 1 to enable the component manager integration with the build system.
It helps: https://docs.espressif.com/projects/esp ... nager.html

khervey
Posts: 3
Joined: Sun Aug 18, 2024 1:56 am

Re: "no module named idf_component_manager" with clion

Postby khervey » Wed Sep 25, 2024 8:35 pm

Bracklord,

Thank you for your follow up on how to get things working on CLion. I am beginning development with CLion, C language with most of my previous experience with IntelliJ/Java/Maven. But of course that was for enterprise software, not Embedded software for microcontrollers.
You can find me on LinkedIn and elsewhere as "Kent Hervey"

Who is online

Users browsing this forum: Google [Bot] and 239 guests