vscode-esp-idf-extension: ESP-IDF instalation failed on Creating a new Python environment (VSC-1158)

OS

Windows

Operating System version

Windows 10

Visual Studio Code version

1.80.1

ESP-IDF version

4.4.5

Python version

3.11.4

Doctor command output

pip 22.3.1 from D:\Espressif\tools\tools\idf-python\3.11.2\Lib\site-packages\pip (python 3.11)

Collecting virtualenv
  Using cached virtualenv-20.24.2-py3-none-any.whl (3.0 MB)
Collecting distlib<1,>=0.3.7
  Using cached distlib-0.3.7-py2.py3-none-any.whl (468 kB)
Collecting filelock<4,>=3.12.2
  Using cached filelock-3.12.2-py3-none-any.whl (10 kB)
Collecting platformdirs<4,>=3.9.1
  Using cached platformdirs-3.9.1-py3-none-any.whl (16 kB)
Installing collected packages: distlib, platformdirs, filelock, virtualenv
Successfully installed distlib-0.3.7 filelock-3.12.2 platformdirs-3.9.1 virtualenv-20.24.2
Installing virtualenv
Creating a new Python environment in D:\Espressif\tools\python_env\idf4.4_py3.11_env

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: D:\Espressif\tools\tools\idf-python\3.11.2\python.exe -m pip install --upgrade pip
D:\Espressif\tools\tools\idf-python\3.11.2\python.exe: No module named virtualenv
Traceback (most recent call last):
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1976, in <module>
    main(sys.argv[1:])
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1972, in main
    action_func(args)
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1598, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'virtualenv',
  File "subprocess.py", line 413, in check_call
subprocess.CalledProcessError: Command '['D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe', '-m', 'virtualenv', '--python', 'D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe', '--seeder', 'pip', 'D:\\Espressif\\tools\\python_env\\idf4.4_py3.11_env']' returned non-zero exit status 1.
Command failed: "D:\Espressif\tools\tools\idf-python\3.11.2\python.exe" "D:\Espressif\esp-idf\tools\idf_tools.py" install-python-env

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: D:\Espressif\tools\tools\idf-python\3.11.2\python.exe -m pip install --upgrade pip
D:\Espressif\tools\tools\idf-python\3.11.2\python.exe: No module named virtualenv
Traceback (most recent call last):
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1976, in <module>
    main(sys.argv[1:])
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1972, in main
    action_func(args)
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1598, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'virtualenv',
  File "subprocess.py", line 413, in check_call
subprocess.CalledProcessError: Command '['D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe', '-m', 'virtualenv', '--python', 'D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe', '--seeder', 'pip', 'D:\\Espressif\\tools\\python_env\\idf4.4_py3.11_env']' returned non-zero exit status 1.
Command failed: "D:\Espressif\tools\tools\idf-python\3.11.2\python.exe" "D:\Espressif\esp-idf\tools\idf_tools.py" install-python-env

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: D:\Espressif\tools\tools\idf-python\3.11.2\python.exe -m pip install --upgrade pip
D:\Espressif\tools\tools\idf-python\3.11.2\python.exe: No module named virtualenv
Traceback (most recent call last):
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1976, in <module>
    main(sys.argv[1:])
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1972, in main
    action_func(args)
  File "D:\Espressif\esp-idf\tools\idf_tools.py", line 1598, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'virtualenv',
  File "subprocess.py", line 413, in check_call
subprocess.CalledProcessError: Command '['D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe', '-m', 'virtualenv', '--python', 'D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe', '--seeder', 'pip', 'D:\\Espressif\\tools\\python_env\\idf4.4_py3.11_env']' returned non-zero exit status 1.


consol.log

Extension

esp_idf_vsc_ext.log

Description

I’ve tried to install ESP-IDF using esp-idf-extension-1.6.4 in VSCode with version v4.3.5 and v4.4.5 and always get the same issue with creation of virtual environment. However once I copy and paste it to terminal window I can create this virtualenv using command D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe -m virtualenv --python D:\\Espressif\\tools\\tools\\idf-python\\3.11.2\\python.exe --seeder pip D:\\Espressif\\tools\\python_env\\idf4.4_py3.11_env I’ve even changed the default integrated terminal from bash to cmd (as I thought that might be a problem) but it still the same

Debug Message

N/A

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 18

Most upvoted comments

Added the fix in #1021 You can try the vsix installer artifacts from this pull request.

Check the vsix installer

To make full view, I’ve been able to create the virtualenv manually from terminal, and after reboot of computer I’ve tried to recover installation using Global --> Use existing setup --> Search ESP-IDF in system. And here is the log captured from terminal in this process. consol_2.log

Now my ESP-IDF is up and running

Hello all, i also had this problem and solved it by working with an older esp-idf extension in the vs code. I downloaded version 1.6.1 manually at: https://github.com/espressif/vscode-esp-idf-extension/tags

And then manually installed the .vsix file in the extensions.

Then old esp-idf versions also run.

Many greetings Hendrik