I have miniconda installed with automatic base environment activation using /usr/bash in the Terminal.app. When I first open Terminal.app and run python the correct interpreter inside the base environment is run, say Python3.8.
Inside VSCode (without necessarily having opened it using something like code .) I have the integrated terminal, which opens bash as expected. The prompt is in fact the same as when I open Terminal.app: say (base) $. However, if I run python, MacOS's system Python2.7 is activated, instead of conda's Python.
The only way I've found to actually run the Python interpreter from within conda's base environment, automatically and consistently with Terminal.app, is to run conda deactivate, then conda activate again. In fact, if I search for Python executables in the environment, by typing python then clicking tab from within the first initialization of the integrated bash terminal, the results include executables that are only available within conda's base environment, which leads me to believe that I have that environment truly activated.
Furthermore, if I use the Select Python Interpreter in VSCode and choose the base environment, when I activate the integrated terminal it will run source ~/opt/miniconda3/bin/activate base, and even then if I run python, conda's Python interpreter is ignored, and I will get MacOS's Python2.7.
I have tried setting both python.pythonPath and python.condaPath options to the default base Python in settings.json, with no success.
Somehow VSCode is activating conda's environment, as expected, but is overwriting the python command to the system's default Python2.7, instead of the environment's default Python3.8. How do I get VSCode to run the Python interpreter consistently with the conda's base environment, like Terminal.app does?