如何修复 'command not found: pio' 即使 PlatformIO 已安装
问题:
你已使用 Visual Studio Code 在计算机上安装了 PlatformIO,但是当你在终端/shell 中尝试运行它时,你看到:
pio_not_found_output.txt
$ pio
zsh: command not found: pio解决方案
PlatformIO 安装在 $HOME/.platformio,但未添加到 PATH 环境变量中,因此你的终端找不到它。使用以下命令添加
add_platformio_path.sh
echo "export PATH=\$PATH:/home/${USER}/.platformio/penv/bin" >> ~/.profile然后从当前会话注销并重新登录(或重启)以使更改生效。之后,你可以从任何 shell 运行 pio。
Check out similar posts by category:
Linux, PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow