4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VSCodeが仮想環境にインストールしたパッケージを認識してくれないときの対処法

4
Last updated at Posted at 2026-01-25

VSCodeでPythonを書いていると、たまに仮想環境にインストールしたパッケージを認識してくれないことがある。

画像1

コーディングは続けられるが波線がいっぱいだし入力補完も効かないのでストレスが溜まる。

この場合VSCodeがPython環境の参照先を間違えている可能性がある。

対処法

コマンドパレットを開き、> select interpreter等で検索してPython: Select Interpreterを選択する。

画像2

正しいPython環境を選択する。

画像3

するとVSCodeがパッケージを認識し、波線は消え、入力補完も効く、希望に満ち溢れた世界がやってくる。

画像4

4
8
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
4
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?