安装esp-idf5.3,参考了一下链接
https://blog.51cto.com/zyxfighting/10579230
官方链接
https://www.bilibili.com/video/BV1YcpHewE6x/?vd_source=8d0989caec7829dc1b2933f6a3b45e6d
卡在python virtual enviroment 安装
报一下错误
Python 3.11.2
pip 24.2 from d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip (python 3.11)
Requirement already satisfied: pip in d:\espressif\tools\python_env\idf5.3_py3.11_env\lib\site-packages (24.2)
Collecting setuptools
Using cached setuptools-71.0.0-py3-none-any.whl.metadata (6.5 kB)
Downloading setuptools-71.0.0-py3-none-any.whl (908 kB)
0.0/908.4 kB ? eta -:--:--
ERROR: Exception:
Traceback (most recent call last):
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher
yield
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\urllib3\response.py", line 561, in read
data = self._fp_read(amt) if not fp_closed else b""
^^^^^^^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\urllib3\response.py", line 527, in _fp_read
return self._fp.read(amt) if amt is not None else self._fp.read()
^^^^^^^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 98, in read
data: bytes = self.__fp.read(amt)
^^^^^^^^^^^^^^^^^^^
File "http\client.py", line 465, in read
File "socket.py", line 706, in readinto
File "ssl.py", line 1278, in recv_into
File "ssl.py", line 1134, in read
TimeoutError: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\cli\base_command.py", line 105, in _run_wrapper
status = _inner_run()
^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\cli\base_command.py", line 96, in _inner_run
return self.run(options, args)
^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\commands\install.py", line 379, in run
requirement_set = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 179, in resolve
self.factory.preparer.prepare_linked_requirements_more(reqs)
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\operations\prepare.py", line 554, in prepare_linked_requirements_more
self._complete_partial_requirements(
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\operations\prepare.py", line 469, in _complete_partial_requirements
for link, (filepath, _) in batch_download:
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\network\download.py", line 184, in __call__
for chunk in chunks:
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\cli\progress_bars.py", line 55, in _rich_progress_bar
for chunk in iterable:
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_internal\network\utils.py", line 65, in response_chunks
for chunk in response.raw.stream(
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\urllib3\response.py", line 622, in stream
data = self.read(amt=amt, decode_content=decode_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\urllib3\response.py", line 560, in read
with self._error_catcher():
File "contextlib.py", line 155, in __exit__
File "d:\Espressif\tools\python_env\idf5.3_py3.11_env\Lib\site-packages\pip\_vendor\urllib3\response.py", line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
Skipping the download of d:\Espressif\tools\espidf.constraints.v5.3.txt because it was downloaded recently.
Upgrading pip and setuptools...
Traceback (most recent call last):
File "d:\Espressif\frameworks\esp-idf-v5.3.1\tools\idf_tools.py", line 3239, in <module>
main(sys.argv[1:])
File "d:\Espressif\frameworks\esp-idf-v5.3.1\tools\idf_tools.py", line 3231, in main
action_func(args)
File "d:\Espressif\frameworks\esp-idf-v5.3.1\tools\idf_tools.py", line 2654, in action_install_python_env
subprocess.check_call(run_args, stdout=sys.stdout, stderr=sys.stderr, env=env_copy)
File "subprocess.py", line 413, in check_call
subprocess.CalledProcessError: Command '['d:\\Espressif\\tools\\python_env\\idf5.3_py3.11_env\\Scripts\\python.exe', '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools', '--constraint', 'd:\\Espressif\\tools\\espidf.constraints.v5.3.txt']' returned non-zero exit status 2.
non zero exit code 1
解决方法:通过设置pip国内镜像源,解决下载超时的问题
- 根据上面最后报错信息的最后两行,
subprocess.CalledProcessError: Command '['d:\\Espressif\\tools\\python_env\\idf5.3_py3.11_env\\Scripts\\python.exe', '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools', '--constraint', 'd:\\Espressif\\tools\\espidf.constraints.v5.3.txt']' returned non-zero exit status 2.
non zero exit code 1
-
确定python路径
d:\\Espressif\\tools\\python_env\\idf5.3_py3.11_env\\Scripts\\python.exe
-
python同级目录有pip3.exe
-
重新开一个终端,设置pip为国内镜像源
D:\Espressif\tools\tools\idf-python\3.11.2\Scripts\pip3.11.exe config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- 然后再重新启动vscode,配置esp-idf,安装即可