ESP-IDF v4.1 trouble with .bat file

mikemoy
Posts: 605
Joined: Fri Jan 12, 2018 9:10 pm

ESP-IDF v4.1 trouble with .bat file

Postby mikemoy » Sat Aug 29, 2020 7:47 pm

I have a strange issue, that I have not encountered before with prior versions of ESP-IDF.
After using the "ESP-IDF Tools Installer" it gives you a shortcut on the desktop to get things set up, and v4.1 works just fine.
What I wind up doing so I do not have to run this shortcut each time is I run the shortcut once to see what paths its adding. I copy them and add them permanently to my windows path. This has always worked until now. This is the list of paths it adds.

C:\Users\Mike\ESP32\.espressif\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32-elf\bin
C:\Users\Mike\ESP32\.espressif\tools\xtensa-esp32s2-elf\esp-2020r2-8.2.0\xtensa-esp32s2-elf\bin
C:\Users\Mike\ESP32\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
C:\Users\Mike\ESP32\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
C:\Users\Mike\ESP32\.espressif\tools\cmake\3.13.4\bin
C:\Users\Mike\ESP32\.espressif\tools\openocd-esp32\v0.10.0-esp32-20191114\openocd-esp32\bin
C:\Users\Mike\ESP32\.espressif\tools\ninja\1.9.0\
C:\Users\Mike\ESP32\.espressif\tools\idf-exe\1.0.1\
C:\Users\Mike\ESP32\.espressif\tools\ccache\3.7\
C:\Users\Mike\ESP32\.espressif\python_env\idf4.1_py3.8_env\Scripts
C:\Users\Mike\ESP32\esp-idf\tools

When I added them this time and ran the shortcut to verify it does not need to add anything I get:
Checking if Python packages are up to date...
The following Python requirements are not satisfied:
esp-windows-curses; sys_platform == 'win32'
To install the missing packages, please run "C:\Users\Mike\ESP32\esp-idf\install.bat"


I did run install.bat, and when I close the command prompt, and open it again I get the same problem.
I have narrowed the problem when I add this line.
C:\Users\Mike\ESP32\.espressif\python_env\idf4.1_py3.8_env\Scripts

Anyone have any ideas why adding this to my windows path would cause this issue ?

User avatar
ESP_Roland
Posts: 241
Joined: Tue Oct 09, 2018 10:28 am

Re: ESP-IDF v4.1 trouble with .bat file

Postby ESP_Roland » Mon Aug 31, 2020 7:01 am

Hi mikemoy,

please also check the original content of your PATH. I assume that there is path to another Python.

In general, the issue is cause by installing the package with one Python but then checking the requirements with another one.

mikemoy
Posts: 605
Joined: Fri Jan 12, 2018 9:10 pm

Re: ESP-IDF v4.1 trouble with .bat file

Postby mikemoy » Mon Aug 31, 2020 11:47 am

Thank you for the response. Unfortunately, I dont have another python path. Here is mine.

Annotation 2020-08-31 064612.png
Annotation 2020-08-31 064612.png (34.71 KiB) Viewed 5947 times

mikemoy
Posts: 605
Joined: Fri Jan 12, 2018 9:10 pm

Re: ESP-IDF v4.1 trouble with .bat file

Postby mikemoy » Sun Sep 13, 2020 11:02 pm

What I fail to understand is if i add the following to my windows path, there should not be an issue. Yet there is.
On ESP-IDF v3.3 this approach worked fine. So what has changed ?
C:\Users\Mike\ESP32\.espressif\tools\xtensa-esp32-elf\esp-2020r2-8.2.0\xtensa-esp32-elf\bin
C:\Users\Mike\ESP32\.espressif\tools\xtensa-esp32s2-elf\esp-2020r2-8.2.0\xtensa-esp32s2-elf\bin
C:\Users\Mike\ESP32\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
C:\Users\Mike\ESP32\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
C:\Users\Mike\ESP32\.espressif\tools\cmake\3.13.4\bin
C:\Users\Mike\ESP32\.espressif\tools\openocd-esp32\v0.10.0-esp32-20191114\openocd-esp32\bin
C:\Users\Mike\ESP32\.espressif\tools\ninja\1.9.0\
C:\Users\Mike\ESP32\.espressif\tools\idf-exe\1.0.1\
C:\Users\Mike\ESP32\.espressif\tools\ccache\3.7\
C:\Users\Mike\ESP32\.espressif\python_env\idf4.1_py3.8_env\Scripts
C:\Users\Mike\ESP32\esp-idf\tools
After adding the above, when I run the command prompt shortcut it says:
Checking if Python packages are up to date...
The following Python requirements are not satisfied:
click>=5.0
pyserial>=3.0
future>=0.15.2
cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
esp-windows-curses; sys_platform == 'win32'
To install the missing packages, please run "C:\Users\Mike\ESP32\esp-idf\install.bat
I run C:\Users\Mike\ESP32\esp-idf\install.bat, it does its thing, yet when I close the window, and run the shortcut again it says the same thing. Why is this?

User avatar
ESP_Roland
Posts: 241
Joined: Tue Oct 09, 2018 10:28 am

Re: ESP-IDF v4.1 trouble with .bat file

Postby ESP_Roland » Mon Sep 14, 2020 7:04 am

Hi mikemoy,

C:\Users\Mike\ESP32\.espressif\python_env\idf4.1_py3.8_env\Scripts is a virtual Python environment and is not intended to be set permanently in your PATH because you might get these side effects. This virtual environment should be added to the PATH by the export.bat script but should not be active before running export.bat.

What is your motivation for updating your PATH permanently? Because if you run ESP-IDF Command Prompt then everything will be setup and you don't have to export.bat manually.

mikemoy
Posts: 605
Joined: Fri Jan 12, 2018 9:10 pm

Re: ESP-IDF v4.1 trouble with .bat file

Postby mikemoy » Mon Sep 14, 2020 12:56 pm

Thank you for the reply. The reason why I am trying to use it this way is because I use Visual Studio Code with my own custom settings.
I have been using it this way since before ESP-IDF v3.3 and has worked great. Now with ESP-IDF v4.1 I an crippled using it because something has changed and cannot figure out what.

My setup is similar to the Visual Studio Code Extension "Espressif IDF 0.4.0". The major difference is that mine has more icon shortcuts, and using the serial monitor along with flashing works. The Espressif extension causes issues.

User avatar
ESP_Roland
Posts: 241
Joined: Tue Oct 09, 2018 10:28 am

Re: ESP-IDF v4.1 trouble with .bat file

Postby ESP_Roland » Mon Sep 14, 2020 1:20 pm

A lot of things have been changed between v3.3 and v4.1. If you want to hack ESP-IDF and try to use it a unsupported way then looking at differences between branches might be a good starting point. For example something similar:

Code: Select all

git difftool origin/release/v3.3  origin/release/v4.1  -- export.bat install.bat tools/idf_tools.py

Who is online

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