0

I'm using clion + mingw for ESP32 development. When reloading cmake I get a python error 'SyntaxError: invalid syntax' for:

info(f'Downloading {url}')

I've set path variable to espressif paths into PATH env variable:

C:\Users\<user>\.espressif\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin;C:\Users\<user>\.espressif\tools\riscv32-esp-elf-gdb\12.1_20221002\riscv32-esp-elf-gdb\bin;C:\Users\<user>\.espressif\tools\xtensa-esp32-elf\esp-12.2.0_20230208\xtensa-esp32-elf\bin;C:\Users\<user>\.espressif\tools\xtensa-esp32s2-elf\esp-12.2.0_20230208\xtensa-esp32s2-elf\bin;C:\Users\<user>\.espressif\tools\xtensa-esp32s3-elf\esp-12.2.0_20230208\xtensa-esp32s3-elf\bin;C:\Users\<user>\.espressif\tools\riscv32-esp-elf\esp-12.2.0_20230208\riscv32-esp-elf\bin;C:\Users\<user>\.espressif\tools\esp32ulp-elf\2.35_20220830\esp32ulp-elf\bin;C:\Users\<user>\.espressif\tools\cmake\3.24.0\bin;C:\Users\<user>\.espressif\tools\openocd-esp32\v0.11.0-esp32-20221026\openocd-esp32\bin;C:\Users\<user>\.espressif\tools\ninja\1.10.2\;C:\Users\<user>\.espressif\tools\idf-exe\1.0.3\;C:\Users\<user>\.espressif\tools\ccache\4.6.2\ccache-4.6.2-windows-x86_64;C:\Users\<user>\.espressif\tools\dfu-util\0.11\dfu-util-0.11-win64;C:\Users\<user>\.espressif\python_env\idf5.1_py3.10_env\Scripts;D:\Programs\esp-idf\tools;C:\Program Files\Python310\Scripts\;C:\Program Files\Python310\;....

however mingw path gets prefixed and cmake uses mingw's python which is 2.7.13 and the python is actually mingw's, not the one that I installed. Path dumped in cmake:

Environment variable PATH: D:\bin\mingw64\mingw64\bin;C:\Users\<user>\.espressif\tools\xtensa-esp-elf-gdb\12.1_20221002\xtensa-esp-elf-gdb\bin;.....

How do I force using of python from the esp virtual environment that I set up.

setting this environment variable doesn't help: IDF_PYTHON_ENV_PATH=C:\Users<user>.espressif\python_env\idf5.1_py3.11_env\Scripts

P.S. I read here:

PYTHON - Python interpreter used for the build; set from PYTHON environment variable if available, if not “python” is used

So I set PYTHON environment variable to this:

C:\Users\<user>\.espressif\python_env\idf5.1_py3.11_env\Scripts\python.exe

Now cmake works, but only if I remove IDF_PYTHON_ENV_PATH variable. Not sure why.

So this is a nice workaround, but is there a way to append instead of prepend mingw path? Who adds the mingw path. Clion? mingw itself?

NickSoft
  • 3,215
  • 5
  • 27
  • 48

0 Answers0