### Bug description

**This is the code -- full qmd below**

```{python}
#| echo: true

from sympy.solvers.diophantine.diophantine import diop_solve
from sympy import symbols

```

**This is the error message:**

ModuleNotFoundError: No module named 'sympy'

Sympy is installed in my virtual environment. When I start Python from my virtual environment and I run the code snippet, it runs.

I have tried doing !pip install sympy and !pip3 install sympy from within the code snipped and it runs but does not change the error message. 

Whether I try to render as a docx, PDF, or word document does not change the outcome.

**This is the full QMD that gets me the error message**. I have also tried adding pip install sympy and pip3 install sympy from the code snippet and it runs but does not affect the error message

---
title: "Solving A Linear Equation Two Ways In Python"
author: "Abigail Haddad"
date: "March 08, 2023"
---


```{python}
#| echo: true
from sympy.solvers.diophantine.diophantine import diop_solve
from sympy import symbols

```

I am running this on Windows from a virtual environment. I am not using RStudio. 

### Checklist

- [X] Please include 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] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cderv
2023-03-09T00:28:38Z
abigailhaddad
windows python-setup
v1.4
closed
ModuleNotFoundError: No module named 'sympy'
https://github.com/quarto-dev/quarto-cli/issues/4716