官方vscode安装出错

Xiaoci
Posts: 3
Joined: Wed Jul 13, 2022 6:43 pm

官方vscode安装出错

Postby Xiaoci » Sat Jul 29, 2023 12:46 pm

我在主机和虚拟机安装espidf时候到最后那个python虚拟环境就出错了

Code: Select all

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 c:\Users\xiaoci\python_env\idf4.3_py3.11_env
  WARNING: The script virtualenv.exe is installed in 'C:\Users\xiaoci\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: c:\Users\xiaoci\tools\idf-python\3.11.2\python.exe -m pip install --upgrade pip
c:\Users\xiaoci\tools\idf-python\3.11.2\python.exe: No module named virtualenv
Traceback (most recent call last):
  File "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py", line 1855, in <module>
    main(sys.argv[1:])
  File "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py", line 1851, in main
    action_func(args)
  File "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py", line 1547, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'virtualenv'] +
  File "subprocess.py", line 413, in check_call
subprocess.CalledProcessError: Command '['c:\\Users\\xiaoci\\tools\\idf-python\\3.11.2\\python.exe', '-m', 'virtualenv', '--python', 'c:\\Users\\xiaoci\\tools\\idf-python\\3.11.2\\python.exe', '--seeder', 'pip', 'c:\\Users\\xiaoci\\python_env\\idf4.3_py3.11_env']' returned non-zero exit status 1.
Command failed: "c:\Users\xiaoci\tools\idf-python\3.11.2\python.exe" "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py" install-python-env
  WARNING: The script virtualenv.exe is installed in 'C:\Users\xiaoci\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: c:\Users\xiaoci\tools\idf-python\3.11.2\python.exe -m pip install --upgrade pip
c:\Users\xiaoci\tools\idf-python\3.11.2\python.exe: No module named virtualenv
Traceback (most recent call last):
  File "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py", line 1855, in <module>
    main(sys.argv[1:])
  File "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py", line 1851, in main
    action_func(args)
  File "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py", line 1547, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'virtualenv'] +
  File "subprocess.py", line 413, in check_call
subprocess.CalledProcessError: Command '['c:\\Users\\xiaoci\\tools\\idf-python\\3.11.2\\python.exe', '-m', 'virtualenv', '--python', 'c:\\Users\\xiaoci\\tools\\idf-python\\3.11.2\\python.exe', '--seeder', 'pip', 'c:\\Users\\xiaoci\\python_env\\idf4.3_py3.11_env']' returned non-zero exit status 1.
Command failed: "c:\Users\xiaoci\tools\idf-python\3.11.2\python.exe" "c:\Users\xiaoci\esp\esp-idf\esp-idf\tools\idf_tools.py" install-python-env
  WARNING: The script virtualenv.exe is installed in 'C:\Users\xiaoci\AppData\Roaming\Python\Python311\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

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


ESP_Penguin_Helper
Posts: 156
Joined: Tue Jul 11, 2023 6:55 am

Re: 官方vscode安装出错

Postby ESP_Penguin_Helper » Thu Aug 03, 2023 2:39 am

你好,

有可能是你的 ESP-IDF Tools directory 的 path 没有⾃动找到,请检查 IDF_PATH 和 IDF_TOOLS_PATH 的路径是否正确。如果不正确的话,需要在 IDF 插件最开始的安装时⼿动更改 IDF_TOOLS_PATH。 在 Espressif ⾥选择 tools 文件夹,例如 C:\Espressif\tools。

如果 IDF_PATH 和 IDF_TOOLS_PATH 全部配置正确后依然遇到同样的报错,大概率是因为 VScode 的 IDF 插件会自动安装3.11 的 python,而你环境中的 python 起了冲突。最简单的解决方式是将插件版本回退到 v1.6.3,进入插件管理界面,选择 install another version,然后选择 v1.6.3。这样应该可以解决你的问题。

如果依然没有解决的话,可以考虑检查你环境中的 Python 环境并进行更新。
Attachments
IDF_change_version.png
IDF_change_version.png (120.19 KiB) Viewed 1830 times
IDF_change_version_2.png
IDF_change_version_2.png (49.14 KiB) Viewed 1830 times

18942487161
Posts: 16
Joined: Sat Jul 29, 2023 4:40 pm

Re: 官方vscode安装出错

Postby 18942487161 » Thu Aug 03, 2023 9:43 am

新版本的IDF会帮你安装3.11,可能会跟你的python环境冲突,回退1.6.3版本可以完美解决问题

Who is online

Users browsing this forum: No registered users and 136 guests