LoginSignup
0
0

Visual Studio Codeが仮想環境のカーネルを認識してくれない

Last updated at Posted at 2024-01-22

環境

  • Macbook Pro
  • Visual Studio Code
  • Poetry
  • Pyenv

仮想環境をactivateしたのに、カーネル一覧に今さっきactivateしたカーネルが出てこない

以下のように仮想環境をactivateした

$ poetry shell
(virtual-env-name)$

なのにカーネル一覧に今activateしたvirtual-env-nameくんが出てきてくれない
image.png

開いてるフォルダ階層をプロジェクトフォルダにしたら認識してくれた

vscode上で開いているディレクトリ階層が親すぎた。
project_dirの一つ上のフォルダ階層を開いていた。

.
├── other_dir0
├── other_dir1
└── project_dir

VSCode上のopen folderからちゃんとプロジェクトフォルダを開き直したらプロジェクトフォルダでactivateした仮想環境のカーネルを認識してくれた!

0
0
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
0
0