pi@raspberrypi:~ $ curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py
pi@raspberrypi:~ $ python3 get-platformio.py
Installer version: 1.2.1
Platform: Linux-6.1.21-v8+-aarch64-with-glibc2.31
Python version: 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
Python path: /usr/bin/python3
Creating a virtual environment at /home/pi/.platformio/penv
Error: Can not install PlatformIO Core due to a missed `venv` module in your Python installation.
Please install this package manually using the OS package manager. For example:
$ apt-get install python3.9-venv
(MAY require administrator access `sudo`)
2個目のコマンドで失敗したので、エラーメッセージに従う。
1234567891011
pi@raspberrypi:~ $ apt-get install python3.9-venv
pi@raspberrypi:~ $ python3 get-platformio.py
...
PlatformIO Core has been successfully installed into an isolated environment `/home/pi/.platformio/penv`!
The full path to `platformio.exe` is `/home/pi/.platformio/penv/bin/platformio`
If you need an access to `platformio.exe` from other applications, please install Shell Commands
(add PlatformIO Core binary directory `/home/pi/.platformio/penv/bin` to the system environment PATH variable):
See https://docs.platformio.org/page/installation.html#install-shell-commands
環境変数PATHを設定しろとのことなので、.bashrcあたりに以下を追記しておく
1
PATH=${PATH}:${HOME}/.platformio/penv/bin
確認
12
pi@raspberrypi:~ $ pio --version
PlatformIO Core, version 6.1.11