2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PlatformIOのインストールでハマった話と対処法

2
Last updated at Posted at 2023-04-14

大学で使うということなので、WindowsのVSCodeにPlatformIO IDEをインストールしました。
その途中で詰まったので、対処法を記しておきます。

詰まった内容

VSCodeにPlatformIOをインストールすると、初期設定が走って進捗状況が右下の表示されます。プログレスバーが中盤に差し掛かった頃に、

PlatformIO: Can not find working Python 3.9+ Interpreter.
Please install the latest Python 3 and restart VSCode

というメッセージが表示されました。

その時の状況を再現することができなかったので、同様のエラーが出ていたissueにあった画像を示しておきます。
message.png

Ancondaを使って3.9以上のPythonは複数インストール済みでパスまで通しているので、エラーが出た事は理解できませんでした。

対処法1 指示通りPythonを追加でインストールする

調べると、Windows環境のVisual Studio Code + PlatformIO IDEでエラーが起こる場合の対処法の記事があり、Python3系を新たにインストールすることで解決できるとのことでした。
実際、上記メッセージにInstall Pythonのボタンがあったので、リンク先ページに言われた通りにインストールしました。しかし、再起動したものの状況は変わりませんでした。

対処法2 PATHの優先順位を変える

VSCodeとPlatformIOで調べ続けると、PlatformIO CommunityAnaconda is not supported.という文面を目にしました。
where pythonで調べてみると、PATHの優先順位的にAnacondaが最優先になっていました。このため、Python3を新しくインストールしても埋もれてしまい、状況が変わらなかったようです。
早速PATHの順番を変えて再度試してみると、無事インストールが成功しました!
image.png

おわりに

今までAnacondaがあれば何でも対応できると思っていました。
Anacondaダメってことがあるんですね。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?