如何解决CalledProcessError: Command ...返回非零退出状态 1
我无法安装 esp-idf。从 git 克隆后,esp-idf 创建目录(存储库?)~/esp/esp-idf(我在 ~/esp 中克隆,它创建了 esp-idf 目录)。当我尝试运行安装时,出现此错误
CalledProcessError: Command '['/usr/bin/python','-m','virtualenv','/home/thabo/.espressif/python_env/idf4.2_py3.8_env']' returned non-zero exit status 1.
这是我运行 ./install.sh 时发生的情况
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf,xtensa-esp32s2-elf,esp32ulp-elf,esp32s2ulp-elf,openocd-esp32
Skipping xtensa-esp32-elf@esp-2020r3-8.4.0 (already installed)
Skipping xtensa-esp32s2-elf@esp-2020r3-8.4.0 (already installed)
Skipping esp32ulp-elf@2.28.51-esp-20191205 (already installed)
Skipping esp32s2ulp-elf@2.28.51-esp-20191205 (already installed)
Skipping openocd-esp32@v0.10.0-esp32-20200709 (already installed)
Installing Python environment and packages
Creating a new Python environment in /home/thabo/.espressif/python_env/idf4.2_py3.8_env
ModuleNotFoundError: No module named 'virtualenv.seed.via_app_data'
Traceback (most recent call last):
File "/home/thabo/esp/esp-idf/tools/idf_tools.py",line 1492,in <module>
main(sys.argv[1:])
File "/home/thabo/esp/esp-idf/tools/idf_tools.py",line 1488,in main
action_func(args)
File "/home/thabo/esp/esp-idf/tools/idf_tools.py",line 1207,in action_install_python_env
subprocess.check_call([sys.executable,idf_python_env_path],File "/usr/lib/python3.8/subprocess.py",line 364,in check_call
raise CalledProcessError(retcode,cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python','/home/thabo/.espressif/python_env/idf4.2_py3.8_env']' returned non-zero exit status 1.
解决方法
ESP-IDF 工具需要安装 Python 和 Virtualenv 包。 Virtualenv 是独立于 Python 的包,它与 Python 3 中包含的 venv
模块不同。
要解决此问题,请安装 Virtualenv 包。然后重试./install.sh
Debian 示例:
apt-get install virtualenv
可以通过以下命令测试 virtualenv 包:
python -m virtualenv --version
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。