### Bug description

Hello,

I've been working on a qmd file with Python only in VS Code (Windows 10.0.19044) for quite some time, but am suddenly running into `ModuleNotFoundError` errors when trying to render the qmd file (either via button or via terminal with `quarto render file.qmd`) despite no changes in my project folder. 

I've noticed that pressing the render button starts either `quarto render file.qmd` or `quarto preview file.qmd` and I don't understand why this is or when to expect which command.

Strangely if I manually run `quarto preview file.qmd` via terminal it seems to fully render the report and after that I can use the render button and the manual render command?

Edit: it seems to be quite random as `quarto preview` can also lead to the error..?

### `quarto check` Output

```bash
[>] Checking Quarto installation......OK
      Version: 1.0.11
      Path: C:\Users\rindrakusuma\AppData\Local\Programs\Quarto\bin\
      CodePage: unknown

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

[>] Checking Python 3 installation....OK
      Version: 3.10.4
      Path: C:/Users/rindrakusuma/scoop/apps/python/current/python.exe
      Jupyter: 4.10.0
      Kernels: python3

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

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
```

### `quarto tools check` Output

```bash
[>] Inspecting tools

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

### 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?
- [ ] 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.
- [ ] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
2022-07-12T15:12:39Z
ifateri
bug
Future
open
Rendering qmd (button/command) suddenly leads to ModuleNotFoundError
https://github.com/quarto-dev/quarto-cli/issues/1365