Python issues when setting up VS Code

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Python issues when setting up VS Code

Postby espdorian » Mon Dec 28, 2020 1:38 pm

With a working ESP-IDF setup I started to setup VS Code. I run VS Code from ESP-IDF command prompt, which means the environment should be ok.
Plugin configuration failed on Python dependencies, I ran install.bat, it didn't help. I copied the command and ran it from IDF command shell to see what was happening. It reports 'pyparsing' version too low, but when calling pip info it shows a different version, so somehow it mixes with another environment.

I do not have much Python experience, what might be wrong here ?
H:\.espressif\python_env\Scripts>python.exe "h:\projects\esp\esp-idf\esp-idf\tools\check_python_dependencies.py" -r "h:\projects\esp\esp-idf\esp-idf\requirements.txt"

The following Python requirements are not satisfied:
pyparsing>=2.0.3,<2.4.0
esp-windows-curses; sys_platform == 'win32'
To install the missing packages, please run "H:\projects\esp\esp-idf\install.bat"

H:\.espressif\python_env\Scripts>pip show pyparsing
Name: pyparsing
Version: 2.4.7
Summary: Python parsing module
.....
Location: h:\.espressif\python_env\lib\site-packages
.....
The relevant environments vars are as follows:

IDF_PYTHON_DIR=C:\Python36\
IDF_PYTHON_ENV_PATH=H:\.espressif\python_env\idf4.1_py3.6_env
IDF_TOOLS_PATH=H:\.espressif

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Re: Python issues when setting up VS Code

Postby espdorian » Mon Dec 28, 2020 2:32 pm

I overlooked that the version was too high, so for pyparsing it is solved. Still remains a similar issue with curses:
Successfully built esp-windows-curses
Installing collected packages: esp-windows-curses
Attempting uninstall: esp-windows-curses
Found existing installation: esp-windows-curses 0.1
Uninstalling esp-windows-curses-0.1:
Successfully uninstalled esp-windows-curses-0.1
Successfully installed esp-windows-curses-0.1
All done! You can now run:
export.bat
(python_env) H:\projects\esp\esp-idf>python.exe "h:\projects\esp\esp-idf\esp-idf\tools\check_python_dependencies.py" -r "h:\projects\esp\esp-idf\esp-idf\requirements.txt"
The following Python requirements are not satisfied:
esp-windows-curses; sys_platform == 'win32'
To install the missing packages, please run "H:\projects\esp\esp-idf\install.bat"
When I check the folder: .espressif\python_env there are actually two variants of pip and python.exe
.espressif\python_env\idf4.1_py3.6_env\python.exe
.espressif\python_env\scripts\python.exe

When calling .espressif\python_env\idf4.1_py3.6_env\pip it shows curses installed, the other one does not.

What is expected here and which python.exe is expected to be in the IDF_PYTHON_DIR which is currently: C:\Python36\

I expected it to be trivial to configure the ESP plugin, but it seems not :(

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: Python issues when setting up VS Code

Postby ESP_bignacio » Tue Dec 29, 2020 7:05 am

Have you configure the extension using the ESP-IDF: Configure ESP-IDF extension command ?

Steps are explained here : https://github.com/espressif/vscode-esp ... OARDING.md

or check our Youtube video

espdorian
Posts: 33
Joined: Sat Dec 26, 2020 10:57 am

Re: Python issues when setting up VS Code

Postby espdorian » Tue Dec 29, 2020 9:34 am

Yes, but it failed when checking for the required Python libraries. Somehow it mixed 2 Python environments. Finally I completely deleted and re-installed the tools (esp-idf-tools-setup-2.3.exe) after which the problem disappeared.

Who is online

Users browsing this forum: No registered users and 63 guests