Another issue installing ESP32 toolchain

For general Flowcode discussion that does not belong in the other sections.
Post Reply
chico
Posts: 8
http://meble-kuchenne.info.pl
Joined: Thu Dec 17, 2020 7:53 pm
Has thanked: 1 time
Been thanked: 1 time

Flowcode v10 Another issue installing ESP32 toolchain

Post by chico »

Hi - Long-time FC user here who's finally taking a closer look at v10...

I'm sure there's a fairly easy fix for this, but I haven't been able to make anything I've found in the forums work for me.

I'm attempting to install the ESP32 toolchain. I followed exactly the clear instructions posted here: https://www.flowcode.co.uk/wiki/index.p ... _Toolchain

The install seems to have gone well, but when I attempt to compile a simple blink project it appears that esp-ide is trying to use Python 2.7 instead of the Python 3 it installed in the installation process.

From the compilation output:

Code: Select all

Checking if Python packages are up to date...
The following Python requirements are not satisfied:
setuptools>=21
click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4,<35
cffi<1.15;python_version<'3.6'
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
idf-component-manager~=1.0
gdbgui==0.13.2.0; python_version < "3.11"
pygdbmi<=0.9.0.2; python_version < "3.11"
python-socketio<5; python_version < "3.11"
pygdbmi<=0.9.0.2; python_version > "3.10"
reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6,<4
ecdsa>=0.16.0
esp-windows-curses; sys_platform == 'win32'
Please follow the instructions found in the "Set up the tools" section of ESP-IDF Getting Started Guide
Diagnostic information:
    IDF_PYTHON_ENV_PATH: (not set)
    Python interpreter used: C:\Python27\python.exe
    Warning: python interpreter not running from IDF_PYTHON_ENV_PATH
From esp-idf command prompt (cmd.exe):

Code: Select all

Using Python in C:\Users\thisUser\AppData\Local\Programs\Python\Python37\
Python 3.7.3

Checking if Python packages are up to date...
Python requirements from C:\esp-idf\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
From the Windows command line:

Code: Select all

C:\Users\thisUser>python
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
I'm thinking this is an environment or path or esp-idf setup issue, but I'm not sure how to fix it. I provide more verbose output information below. I'm hoping this a commonly seen issue and there's a simple fix (fingers crossed :?: )

Thanks in advance...

More info:

1. esp-idf command prompt (cmd.exe):

Code: Select all

Using Python in C:\Users\thisUser\AppData\Local\Programs\Python\Python37\
Python 3.7.3
Using Git in C:\Program Files\Git\cmd\
git version 2.21.0.windows.1
Setting IDF_PATH: C:\esp-idf

Adding ESP-IDF tools to PATH...
    C:\esp-idf-tools\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin
    C:\esp-idf-tools\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin
    C:\esp-idf-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
    C:\esp-idf-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
    C:\esp-idf-tools\tools\cmake\3.16.4\bin
    C:\esp-idf-tools\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin
    C:\esp-idf-tools\tools\ninja\1.10.0\
    C:\esp-idf-tools\tools\idf-exe\1.0.1\
    C:\esp-idf-tools\tools\ccache\3.7\
    C:\esp-idf-tools\tools\dfu-util\0.9\dfu-util-0.9-win64
    C:\esp-idf-tools\python_env\idf4.2_py3.7_env\Scripts
    C:\esp-idf\tools

Checking if Python packages are up to date...
Python requirements from C:\esp-idf\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build


C:\esp-idf>
2. Windows command line:

Code: Select all

C:\Users\thisUser>python
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Flowcode "Compile to hex" output:

Code: Select all

Target folder: C:\MPLAB Projects\FC10_testing
Source name:   C:\MPLAB Projects\FC10_testing\Flowcode1_esp32.fcfx
Title:         
Description:   
Device:        ESP.ESP32.ESP32_WROOM_32
Generated by:  Flowcode v10.0.4.33
Date:          Friday, August 18, 2023 10:55:20
Users:         1
Registered to: chico (FREE_VERSION)
Licence key: DF7JCQ
   NOT FOR COMMERCIAL USE
https://www.flowcode.co.uk
Using FCD settings for compiler
Launching the compiler...
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ESP\Batch\esp32_build.bat  "C:\esp-idf\" "Flowcode1_esp32" "C:\MPLAB Projects\FC10_testing\" esp32s_sdkconfig esp32 

C:\MPLAB Projects\FC10_testing>REM CRC: 0796FC1E6A776AF9156B257209C35258CE7C28B3EC20AEA2C632DB392A0E4BFD5B3F53B21811978F7B21FE4085045A7E774D1D3D69D8A99EE7320EAE740A5DB6CB88D63C2D6E3613A41BF517A6FEAF3A3307584D5060F214711B8143522C2B69DED9A8239BD70B72B199900461C78937B42DEF8219F63A24580137A2F6C8FDB7553324EFF791947E8AB6FFD612B81BAA97C798A8F1CFC189DE5D38517747C774AF2DD6F839BAECF83F7F994C7164CE77868F480396BDEF2F2C3050DA273BE4EE1A93B7F4BABD60587FC07671DDE8C8B7571E128FEF13BA27 

C:\MPLAB Projects\FC10_testing>REM REVISION: 8.0 

C:\MPLAB Projects\FC10_testing>REM GUID: 955EA920-4961-4C53-BA6B-EF4AF66BB4C2 

C:\MPLAB Projects\FC10_testing>REM DATE: 09\08\2023 

C:\MPLAB Projects\FC10_testing>REM DIR: FCD\ESP\Batch\esp32_build.bat 
.
============================== Toolchain Check ==============================
Python 2.7.10
git version 2.21.0.windows.1
ESP toolchain found at "C:\esp-idf\"
=============================================================================
.
Building: Flowcode1_esp32 ...
IDF Version: v4.2.5-1-g5f8de192fa ...
Setting IDF_PATH: C:\esp-idf

Adding ESP-IDF tools to PATH...
    C:\esp-idf-tools\tools\idf-exe\1.0.1\
    C:\esp-idf-tools\tools\cmake\3.16.4\bin
    C:\esp-idf-tools\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin
    C:\esp-idf-tools\tools\dfu-util\0.9\dfu-util-0.9-win64
    C:\esp-idf-tools\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin
    C:\esp-idf-tools\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin
    C:\esp-idf-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
    C:\esp-idf-tools\tools\ninja\1.10.0\
    C:\esp-idf-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
    C:\esp-idf-tools\tools\ccache\3.7\
    C:\esp-idf\tools
    
Checking if Python packages are up to date...
The following Python requirements are not satisfied:
setuptools>=21
click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4,<35
cffi<1.15;python_version<'3.6'
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
idf-component-manager~=1.0
gdbgui==0.13.2.0; python_version < "3.11"
pygdbmi<=0.9.0.2; python_version < "3.11"
python-socketio<5; python_version < "3.11"
pygdbmi<=0.9.0.2; python_version > "3.10"
reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6,<4
ecdsa>=0.16.0
esp-windows-curses; sys_platform == 'win32'
Please follow the instructions found in the "Set up the tools" section of ESP-IDF Getting Started Guide
Diagnostic information:
    IDF_PYTHON_ENV_PATH: (not set)
    Python interpreter used: C:\Python27\python.exe
    Warning: python interpreter not running from IDF_PYTHON_ENV_PATH
    PATH: C:\esp-idf-tools\tools\idf-exe\1.0.1\;C:\esp-idf-tools\tools\cmake\3.16.4\bin;C:\esp-idf-tools\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin;C:\esp-idf-tools\tools\dfu-util\0.9\dfu-util-0.9-win64;C:\esp-idf-tools\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin;C:\esp-idf-tools\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin;C:\esp-idf-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\esp-idf-tools\tools\ninja\1.10.0\;C:\esp-idf-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\esp-idf-tools\tools\ccache\3.7\;C:\esp-idf\tools;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Python27\;C:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin;C:\Program Files (x86)\Microchip\xc8\v1.43\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microchip\xc8\v2.31\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Mitov\Visuino;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Users\jduncan\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\jduncan\AppData\Local\Programs\Python\Python37\;C:\Users\jduncan\AppData\Local\Microsoft\WindowsApps;;C:\Users\jduncan\AppData\Local\Programs\Microsoft VS Code Insiders\bin
Target: esp32 ...
Traceback (most recent call last):
  File "C:\esp-idf\tools\idf.py", line 45, in <module>
    from idf_py_actions.tools import (executable_exists, idf_version, merge_action_lists, realpath)  # noqa: E402
  File "C:\esp-idf\tools\idf_py_actions\tools.py", line 1, in <module>
    import click
ImportError: No module named click

Build Failed

C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ESP\Batch\esp32_build.bat reported error code 0x1

Autoclose turned off


FINISHED


Steve-Matrix
Matrix Staff
Posts: 1548
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 214 times
Been thanked: 362 times

Re: Another issue installing ESP32 toolchain

Post by Steve-Matrix »

Presumably your PATH environment variable is pointing at the older v2.7 Python installation. You could try manually editing the PATH (Windows Settings...System...Advanced System Settings...Advanced...Environment Variables) so it points at the 3.7 installation instead.

chico
Posts: 8
Joined: Thu Dec 17, 2020 7:53 pm
Has thanked: 1 time
Been thanked: 1 time

Flowcode v10 Re: Another issue installing ESP32 toolchain

Post by chico »

Thanks for the response. Your suggestion solved the problem, although there was an intermediate step which I'll document here in case it might help someone else.

The various installers had done their job, but had left the path pointing to "\Python 3.7\Python.exe" instead of just the folder "\Python 3.7". This caused the compiling process to use Python 2.7 instead of Python 3.7.

Here are the screen shots of what did NOT work correctly:
Screen Shot 2023-08-21 at 12.14.36 PM.jpg
Screen Shot 2023-08-21 at 12.14.36 PM.jpg (159.05 KiB) Viewed 2311 times
Screen Shot 2023-08-21 at 12.15.04 PM.jpg
Screen Shot 2023-08-21 at 12.15.04 PM.jpg (102.51 KiB) Viewed 2311 times
Screen Shot 2023-08-21 at 12.15.53 PM.jpg
Screen Shot 2023-08-21 at 12.15.53 PM.jpg (97.29 KiB) Viewed 2311 times

That setup caused the esp32 compiler to access Python 2.7:

Code: Select all

Target folder: C:\MPLAB Projects\- ESP Projects
Source name:   C:\MPLAB Projects\- ESP Projects\FC10_BlinkTest_ESP32.fcfx
Title:         
Description:   
Device:        ESP.ESP32.ESP32_WROOM_32
Generated by:  Flowcode v10.0.4.33
Date:          Monday, August 21, 2023 12:07:29
Users:         1
Registered to:  (FREE_VERSION)
Licence key: DF7JCQ
   NOT FOR COMMERCIAL USE
https://www.flowcode.co.uk
Using FCD settings for compiler
Launching the compiler...
C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ESP\Batch\esp32_build.bat  "c:\esp-idf\" "FC10_BlinkTest_ESP32" "C:\MPLAB Projects\- ESP Projects\" esp32s_sdkconfig 

C:\MPLAB Projects\- ESP Projects>REM CRC: 0796FC1E6A776AF9156B257209C35258CE7C28B3EC20AEA2C632DB392A0E4BFD5B3F53B21811978F7B21FE4085045A7E774D1D3D69D8A99EE7320EAE740A5DB6EFB7F8B9768FC390BAFB420BC9D6F4D56375EE3039B8BDDEA4D1C56CD1580BF569DAEA777BB49732B199900461C78937B42DEF8219F63A24580137A2F6C8FDB7553324EFF791947E8AB6FFD612B81BAA97C798A8F1CFC189DE5D38517747C774AF2DD6F839BAECF83F7F994C7164CE77868F480396BDEF2F2C3050DA273BE4EEB3E11C07C6C54039FF3C81C780D7ABB89002782687B4F007BB7835FE546B805B7544DA781CA69696 

C:\MPLAB Projects\- ESP Projects>REM REVISION: 2.0 

C:\MPLAB Projects\- ESP Projects>REM GUID: 955EA920-4961-4C53-BA6B-EF4AF66BB4C2 

C:\MPLAB Projects\- ESP Projects>REM DATE: 05\12\2022 

C:\MPLAB Projects\- ESP Projects>REM DIR: FCD\ESP\Batch\esp32_build.bat 
.
============================== Toolchain Check ==============================
Python 2.7.10
git version 2.21.0.windows.1
ESP toolchain found at "c:\esp-idf\"
=============================================================================
.
Building FC10_BlinkTest_ESP32 ...
Setting IDF_PATH: c:\esp-idf

Adding ESP-IDF tools to PATH...
    C:\esp-idf-tools\tools\idf-exe\1.0.1\
    C:\esp-idf-tools\tools\cmake\3.16.4\bin
    C:\esp-idf-tools\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin
    C:\esp-idf-tools\tools\dfu-util\0.9\dfu-util-0.9-win64
    C:\esp-idf-tools\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin
    C:\esp-idf-tools\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin
    C:\esp-idf-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
    C:\esp-idf-tools\tools\ninja\1.10.0\
    C:\esp-idf-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
    C:\esp-idf-tools\tools\ccache\3.7\
    c:\esp-idf\tools
    
Checking if Python packages are up to date...
The following Python requirements are not satisfied:
setuptools>=21
click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4,<35
cffi<1.15;python_version<'3.6'
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
idf-component-manager~=1.0
gdbgui==0.13.2.0; python_version < "3.11"
pygdbmi<=0.9.0.2; python_version < "3.11"
python-socketio<5; python_version < "3.11"
pygdbmi<=0.9.0.2; python_version > "3.10"
reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6,<4
ecdsa>=0.16.0
esp-windows-curses; sys_platform == 'win32'
Please follow the instructions found in the "Set up the tools" section of ESP-IDF Getting Started Guide
Diagnostic information:
    IDF_PYTHON_ENV_PATH: (not set)
    Python interpreter used: C:\Python27\python.exe
    Warning: python interpreter not running from IDF_PYTHON_ENV_PATH
    PATH: C:\esp-idf-tools\tools\idf-exe\1.0.1\;C:\esp-idf-tools\tools\cmake\3.16.4\bin;C:\esp-idf-tools\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin;C:\esp-idf-tools\tools\dfu-util\0.9\dfu-util-0.9-win64;C:\esp-idf-tools\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin;C:\esp-idf-tools\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin;C:\esp-idf-tools\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\esp-idf-tools\tools\ninja\1.10.0\;C:\esp-idf-tools\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\esp-idf-tools\tools\ccache\3.7\;c:\esp-idf\tools;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Users\jduncan\AppData\Local\Programs\Python\Python37\python.exe;C:\Users\jduncan\AppData\Local\Programs\Python\Python37\Scripts;C:\Python27\;C:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin;C:\Program Files (x86)\Microchip\xc8\v1.43\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Microchip\xc8\v2.31\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Mitov\Visuino;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files (x86)\IVI Foundation\IVI\bin;C:\Program Files\IVI Foundation\IVI\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Users\jduncan\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\jduncan\AppData\Local\Programs\Python\Python37\;C:\Users\jduncan\AppData\Local\Microsoft\WindowsApps;;C:\Users\jduncan\AppData\Local\Programs\Microsoft VS Code Insiders\bin
Traceback (most recent call last):
  File "c:\esp-idf\tools\idf.py", line 45, in <module>
    from idf_py_actions.tools import (executable_exists, idf_version, merge_action_lists, realpath)  # noqa: E402
  File "c:\esp-idf\tools\idf_py_actions\tools.py", line 1, in <module>
    import click
ImportError: No module named click

Build Failed

C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\ESP\Batch\esp32_build.bat reported error code 0x1

Autoclose turned off


FINISHED
The fix was to change the environment variable from "\Python 3.7\Python.exe" to just the folder "\Python 3.7".

Thanks for the assistance...

Steve-Matrix
Matrix Staff
Posts: 1548
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 214 times
Been thanked: 362 times

Re: Another issue installing ESP32 toolchain

Post by Steve-Matrix »

Great news. Thanks for letting us know.

Post Reply