记录VSCode配置ESP IDF到最后python virtual environment 错误解决:

这篇具有很好参考价值的文章主要介绍了记录VSCode配置ESP IDF到最后python virtual environment 错误解决:。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

记录VSCode配置ESP IDF到最后python virtual environment 错误解决:

在配置VSCode的扩展件ESP IDF的时候, 最后一步python virtual environment遇到以下错误:

Command failed: "x:/Software/Espressif/python_env/idf4.3_py3.8_env/Scripts/python.exe" -m pip install --upgrade --no-warn-script-location  -r "c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\requirements.txt"
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/gcovr/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/gcovr/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/gcovr/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/gcovr/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/gcovr/
ERROR: Could not find a version that satisfies the requirement gcovr
ERROR: No matching distribution found for gcovr
Command failed: "X:/Software/Espressif/python_env/idf4.3_py3.8_env/Scripts/python.exe" -m pip install --upgrade --no-warn-script-location  -r "c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\requirements.txt"

以及

Could not fetch URL https://pypi.org/simple/gcovr/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/gcovr/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))) - skipping

思来想去应该是连接不到国外的源

换源之:

  1. 关闭VSCode, 打开安装ESP的目录如下
X:\Software\Espressif\python_env\idf4.3_py3.8_env\Scripts
  1. cmd运行activate.bat, 换源, 运行deactivate.bat
activate.bat
pip config set global.index-url http://pypi.douban.com/simple/ 
deactivate.bat

​ 运行结果如下

X:\Software\Espressif\python_env\idf4.3_py3.8_env\Scripts>activate.bat

(idf4.3_py3.8_env) X:\Software\Espressif\python_env\idf4.3_py3.8_env\Scripts>pip config set global.index-url http://pypi.douban.com/simple/
Writing to C:\Users\userName\AppData\Roaming\pip\pip.ini

(idf4.3_py3.8_env) X:\Software\Espressif\python_env\idf4.3_py3.8_env\Scripts>deactivate.bat
  1. 重新打开VSCode, 默认按键F1新建工程, 等待VSCode扩展件检查, 期间还可能遇到以下问题
"X:/Software/Espressif/python_env/idf4.3_py3.8_env/Scripts/python.exe" -m pip install --upgrade --no-warn-script-location -r "c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt"
Looking in indexes: http://pypi.douban.com/simple/
Ignoring typing: markers 'python_version < "3.5"' don't match your environment
Requirement already satisfied: setuptools>=21 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from -r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 1)) (51.3.3)
WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'.
Requirement already satisfied: click in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from -r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 3)) (8.1.3)
WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'.
WARNING: The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host pypi.douban.com'.
ERROR: Could not find a version that satisfies the requirement psutil>=5.5.1 (from versions: none)
ERROR: No matching distribution found for psutil>=5.5.1

错误中发现是命令执行发生的

"X:/Software/Espressif/python_env/idf4.3_py3.8_env/Scripts/python.exe" -m pip install --upgrade --no-warn-script-location -r "c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt"

看来应该是豆瓣源里没有这个资源, 于是更换一个阿里云源试试(若是其他的源也找不到那就再更换国内的其他源), 在刚才的命令行中运行以下命令,:

activate.bat
"X:/Software/Espressif/python_env/idf4.3_py3.8_env/Scripts/python.exe" -m pip install --upgrade --no-warn-script-location -r "c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt" -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
deactivate.bat

以下是执行结果

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Ignoring typing: markers 'python_version < "3.5"' don't match your environment
Requirement already satisfied: setuptools>=21 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from -r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 1)) (51.3.3)
Collecting setuptools>=21
  Downloading http://mirrors.aliyun.com/pypi/packages/3e/83/e206edff58159a927c76bbfeef1bf8b39cb12bbb32ae3c6227deb16d0121/setuptools-64.0.0-py3-none-any.whl (1.2 MB)
     ---------------------------------------- 1.2/1.2 MB 1.2 MB/s eta 0:00:00
Requirement already satisfied: click in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from -r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 3)) (8.1.3)
Collecting psutil>=5.5.1
  Downloading http://mirrors.aliyun.com/pypi/packages/b2/ad/65e2b2b97677f98d718388dc11b2a9d7f177ebbae5eef72547a32bc28911/psutil-5.9.1-cp38-cp38-win_amd64.whl (246 kB)
     ---------------------------------------- 246.8/246.8 kB 1.2 MB/s eta 0:00:00
Requirement already satisfied: pygdbmi<=0.9.0.2 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from -r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 5)) (0.9.0.2)
Collecting pywin32>=227
  Downloading http://mirrors.aliyun.com/pypi/packages/4d/33/251aacef6d983476e4176e3c9b542f60c34735c034392e73762e699e9a5c/pywin32-304-cp38-cp38-win_amd64.whl (12.3 MB)
     ---------------------------------------- 12.3/12.3 MB 1.3 MB/s eta 0:00:00
Requirement already satisfied: requests>=2.21.0 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from -r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 7)) (2.28.0)
Collecting requests>=2.21.0
  Downloading http://mirrors.aliyun.com/pypi/packages/ca/91/6d9b8ccacd0412c08820f72cebaa4f0c0441b5cda699c90f618b6f8a1b42/requests-2.28.1-py3-none-any.whl (62 kB)
     ---------------------------------------- 62.8/62.8 kB 674.4 kB/s eta 0:00:00
Collecting xmlrunner>=1.7.7
  Downloading http://mirrors.aliyun.com/pypi/packages/57/c0/a19e29bc6038a56bb690549573af6ea11a9d2a5c07aff2e27ed308c2cab9/xmlrunner-1.7.7.tar.gz (5.6 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: colorama in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from click->-r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 3)) (0.4.4)
Requirement already satisfied: idna<4,>=2.5 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from requests>=2.21.0->-r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 7)) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from requests>=2.21.0->-r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 7)) (1.26.9)
Requirement already satisfied: charset-normalizer<3,>=2 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from requests>=2.21.0->-r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 7)) (2.0.12)
Requirement already satisfied: certifi>=2017.4.17 in d:\software\espressif\python_env\idf4.3_py3.8_env\lib\site-packages (from requests>=2.21.0->-r c:\Users\userName\.vscode\extensions\espressif.esp-idf-extension-1.4.0\esp_debug_adapter\requirements.txt (line 7)) (2022.5.18.1)
Building wheels for collected packages: xmlrunner
  Building wheel for xmlrunner (setup.py) ... done
  Created wheel for xmlrunner: filename=xmlrunner-1.7.7-py3-none-any.whl size=6235 sha256=43b6fc21ec503430e530d65c7c473a647e0d36bfd062d3f02c2cf2317e84bc66
  Stored in directory: c:\users\userName\appdata\local\pip\cache\wheels\60\ba\96\a2b8a41b87d4fd0c1a10371c90f2714cca6985c782b77cd44a
Successfully built xmlrunner
Installing collected packages: xmlrunner, pywin32, setuptools, requests, psutil
  Attempting uninstall: setuptools
    Found existing installation: setuptools 51.3.3
    Uninstalling setuptools-51.3.3:
      Successfully uninstalled setuptools-51.3.3
  Attempting uninstall: requests
    Found existing installation: requests 2.28.0
    Uninstalling requests-2.28.0:
      Successfully uninstalled requests-2.28.0
Successfully installed psutil-5.9.1 pywin32-304 requests-2.28.1 setuptools-64.0.0 xmlrunner-1.7.7

看来是成功

重新打开VSCode , F1新建ESP IDF工程看看应该以及成功了

PS: 要取消换源使用以下命令

pip config unset global.index-url

设置阿里云源使用以下命令文章来源地址https://www.toymoban.com/news/detail-667296.html

pip config unset global.index-url http://mirrors.aliyun.com/pypi/simple/

到了这里,关于记录VSCode配置ESP IDF到最后python virtual environment 错误解决:的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • ESP-IDF + Vscode ESP32 开发环境搭建以及开发入门

    创作不易,转载请注明出处! Tips: 虽然笔者采用的是Linux开发环境,但是Windows开发环境的亦可阅读,所述内容与系统关联性不大,尤其是后文介绍的如何将自己的文件加入到工程,解决头文件找不到等问题,无论哪种系统均会存在。 Tips: 最近更新了一篇windows下搭建的,大家

    2024年02月02日
    浏览(55)
  • Python虚拟环境(Virtual Environment)

    Python虚拟环境是一种用于隔离和管理项目所需的Python解释器及其依赖库的工具。它可以让我们在同一台机器上同时运行多个项目,并且每个项目都可以有不同的依赖库和Python版本。虚拟环境可以为每个项目提供独立的运行环境,避免各项目之间的依赖冲突。 在开发项目时,我

    2024年01月20日
    浏览(72)
  • vscode+esp-idf 搭建esp32开发环境,编译信息中文乱码

    1.修改波特率 2.C:UsersAdministrator.vscodeextensionsvsciot-vscode.vscode-arduino-0.6.0-win32-x64outsrccommon  打开文件 util.js 屏蔽掉这部分的代码 、  

    2024年02月10日
    浏览(52)
  • 小陈笔记(一):Vscode 安装ESP-IDF插件

            本文主要描述如何在Vscode安装esp-idf插件。同时也是记录自己在安装过程中遇到的日记。 材料:         1.Windows10专业版         2.vscode稳定版本         3.esp-idf4.4.4版         4.硬件:esp32         vscode的安装教程网上有很多优秀的例程,这里就不要一一赘述

    2024年04月22日
    浏览(55)
  • ESP32开发环境搭建Windows VSCode集成Espressif IDF插件ESP32_IDF_V5.0开发编译环境搭建

    下载网址:https://dl.espressif.com/dl/esp-idf/ 打开上面的网页,选择单击页面中 ESP32-IDF v5.0.2 - Offine Installer,5.0.2是当前最新版本,如果没有ESP32-IDF v5.0.2 - Offine Installer,说明官方有更新最新版本,如果想要安装此教程版本可以把页面翻到最下面,会列出所有历史版本供用户下载。

    2024年02月13日
    浏览(58)
  • 0·ESP IDF搭建VScode环境踩坑记(找不到头文件)

    目录 环境搭建 简单记录下自己遇到的问题: ①找不到头文件 ②Cmake插件出现问题 小结 整体的环境搭建,网络上还是有很多教程的,这里就不重复造轮子了,可以参考下面的链接 【ESP32-IDF环境搭建之vscode环境】 官方也有出一个指导教程,可以作为辅助参考,基本还是比较顺

    2024年01月19日
    浏览(54)
  • VSCode安装Esp-IDF开发环境(pip version)出错解决办法

    可以看出是 pip版本问题 ,所以只需要在安装程序使用pip命令之前,完成pip的升级即可。 好像下载4点几的版本会出现此警告,导致安装失败;而下面安装5.0.1版本的时候同样出现了此警告,但是能够安装成功。 在VSCode扩展中找到Esp-IDF插件,点击卸载按钮。 注意:此时并没有

    2024年02月08日
    浏览(69)
  • ESP32的ESP-IDF在VScode工程下,头文件标红警告、报错、无法跳转

    具体问题如下:在VScode环境中,通过ESP-IDF插件开发ESP32系列设备,但是工程代码中提示找不到头文件、相关的函数也无法跳转,这样不仅不美观,也一定程度上影响了开发效率,需要着手解决。 解决方法: 顺利解决的前提是要确保已经正确安装了ESP-IDF和其依赖项。 检查VS

    2024年02月19日
    浏览(64)
  • VScode 安装 ESP-idf 5.0报错:LookupError: unknown encoding: utf-8,gbk

    说明从 pip 源返回的是 utf-8,gbk 编码类型,但是 pip 不能解析。请求了一下 pip 源后发现确实如此。 尝试更新 pip(python -m pip install --upgrade pip),但也会报同样的问题。 这是因为镜像网站给的是 utf-8,gbk;而 python3.8 中最新的 pip,不支持这样的编码类型。 修改 site-packages/pip/_i

    2024年02月16日
    浏览(53)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包