### Bug description

I am currently trying to explore using Quarto for the Python work I am doing in VSCode, where I had traditionally been using VSCode's version of the Jupyter Notebook (.ipynb).

When I took my notebook, and put in the appropriate YAML raw header cell, everything rendered correctly into HTML -- it looked great!

However, when I tried to do the same code from a .qmd file, it did not work.  Specifically, clicking the "render" button kept on referencing the "base" conda environment, when this project was in a different conda environment (with package I did not want to load into the "base" version.   For the .ipynb file, there is a button on the top-right with which to change the environment, and then all the options work correctly.

I can still correctly render the qmd file when in the command line, but I would like to run it using the options in the IDE as well.   Does anyone know of the best way to deal with this issue?

***
When I click "Render HTML", the terminal seems to run a `conda activate base`,  then runs the `quarto preview` , and then (when it fails and exits) runs `conda activate base2` (which is not even the environment I tried to use) ...but when I run it manually in the terminal from within my original project environment, it's fine.

***

I am using VSCode version:
Version: 1.69.2 (Universal)
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:12:57.074Z (2 wks ago)
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Darwin x64 21.4.0

### `quarto check` Output

```bash

[✓] Checking Quarto installation......OK
      Version: 1.0.37
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.8.12 (Conda)
      Path: /Users/federaj/miniconda3/envs/base2/bin/python
      Jupyter: 4.10.0
      Kernels: juliapro_v1.5.3-1-1.5, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
```

### `quarto tools check` Output

```bash
[✓] Inspecting tools

Tool         Status            Installed     Latest
chromium     Not installed     ---           869685
tinytex      Up to date        v2022.08      v2022.08
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [ ] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-08-04T02:59:33Z
AlanFeder
bug
closed
Issue with Quarto/Python/VSCode/.qmd referencing wrong conda environment
https://github.com/quarto-dev/quarto-cli/issues/1673