VisualStudioCodeは賢すぎるのでvenvフォルダがあったりすると、自動でそこのpythonを実行する設定に変えてくれるが、condaのはそこまで見てくれない。
condaの環境にあるpythonのpathを調べて
(test) $ python -a
/Users/hoge/.pyenv/shims/python
/Users/hoge/.pyenv/versions/miniforge3-4.10.3-10/envs/sandbox/bin/python
/usr/bin/python
miniforge下のpythonのpathをVisualStudioCodeに設定してあげればいい。
ちなみに、
(base) $ conda create –name test python=3.9
とかしても、結局pyenvしないとpythonバージョンが変わらないのだが・・
と書きながらcondaのconfig設定変えるのもあったな。