[Solved] Python requirements not met, even though they are

RobMeades
Posts: 85
Joined: Thu Nov 29, 2018 1:12 pm

[Solved] Python requirements not met, even though they are

Postby RobMeades » Fri Jun 05, 2020 10:46 am

I'm having trouble persuading ESP-IDF to find the right version of Python on Windows, even though it has just run all of its install processes. Here is the procedure I have followed (after uninstalling/deleting all traces of Espressif tools and associated paths/environment variables):

1. Open a command prompt with administrator privileges.
2. Clone the latest version of esp-idf from Github into c:\projects\esp-idf-latest.
3. Run c:\projects\esp-idf-latest\install.bat in the command window and let it do its stuff.
4. Run c:\projects\esp-idf-latest\export.bat in the command window and let it do its stuff.
5. CD to my ESP32 build and run c:\projects\esp-idf-latest\tools\idf.py.

idf.py then reports:

Code: Select all

The following Python requirements are not satisfied:
gdbgui>=0.13.2.0
pygdbmi<=0.9.0.2
reedsolo==1.5.3
bitstring>=3.1.6
esp-windows-curses; sys_platform == 'win32'
To install the missing packages, please run "C:\projects\esp-idf-latest\install.bat"
Diagnostic information:
    IDF_PYTHON_ENV_PATH: C:\Users\rob\.espressif\python_env\idf4.2_py2.7_env
    Python interpreter used: C:\Python27\python.exe
    Warning: python interpreter not running from IDF_PYTHON_ENV_PATH
...etc.

Now I do have Python 2.7 elsewhere in my path, as it indicates, but this comes AFTER the ones that were just installed, here is the start of the path according to the command prompt:

Code: Select all

PATH=C:\Users\rob\.espressif\tools\xtensa-esp32-elf\esp-2020r1-8.2.0\xtensa-esp32-elf\bin;C:\Users\rob\.espressif\tools\xtensa-esp32s2-elf\esp-2020r1-8.2.0\xtensa-esp32s2-elf\bin;C:\Users\rob\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin;C:\Users\rob\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin;C:\Users\rob\.espressif\tools\cmake\3.16.4\bin;C:\Users\rob\.espressif\tools\openocd-esp32\v0.10.0-esp32-20200420\openocd-esp32\bin;C:\Users\rob\.espressif\tools\ninja\1.10.0\;C:\Users\rob\.espressif\tools\idf-exe\1.0.1\;C:\Users\rob\.espressif\tools\ccache\3.7\;C:\Users\rob\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64;C:\Users\rob\.espressif\python_env\idf4.2_py2.7_env\Scripts;C:\projects\esp-idf-latest\tools;
I have no Python enviroment variables set. where python returns:

Code: Select all

C:\Users\rob\.espressif\python_env\idf4.2_py2.7_env\Scripts\python.exe
C:\Python27\python.exe
C:\Users\rob\AppData\Local\Microsoft\WindowsApps\python.exe
What am I doing wrong?
Last edited by RobMeades on Fri Jun 05, 2020 11:56 am, edited 1 time in total.

RobMeades
Posts: 85
Joined: Thu Nov 29, 2018 1:12 pm

Re: Python requirements not met, even though they are

Postby RobMeades » Fri Jun 05, 2020 11:55 am

Sussed it. This post:

https://superuser.com/questions/433897/ ... ng-version

...explains that because I'm calling idf.py, Windows uses the registry entry for the .py extension to determine which Python version to run, not the order in the path.

If, however, I call python idf.py then it does pick up the correct version.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], ESP_Roland and 102 guests