### Bug description

I updated from Ubuntu 20 to 22.04 and my system-wide python version changed from 3.8 to 3.10.6. I have checked that python is recognized by quarto. 

```
quarto check all

[✓] Checking Quarto installation......OK
      Version: 1.2.335
      Path: /opt/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: /usr/bin/python3
      Jupyter: 5.2.0
      Kernels: python3, ssam, si_env

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

[✓] Checking R installation...........OK
      Version: 4.1.2
      Path: /usr/lib/R
      LibPaths:
        - /home/matias/R/x86_64-pc-linux-gnu-library/4.1
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      rmarkdown: 2.20

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

```
During running chunk by chunk (inside Rstudio), the code works with no problem. When I try to render in either Rstudio or the command line, I get errors that boil down to "no module named ...". Because quarto is looking for modules in the old `.local/lib/python3.8` directory instead of the proper `python3.10` directory. It's not just one package, I could reproduce this by moving the python3.8 folder one directory up and quarto will find no module (which means it's looking in that path for modules).

I am not using any virtual environment for this project, and Rstudio also finds python correctly 

![image](https://user-images.githubusercontent.com/7494967/223497239-ab4a4a42-a7cc-491e-9940-6f7e33d68978.png)

I uninstalled and reinstalled quarto but still face this issue. Just in case this is needed, I put my session info

```
sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.1.2 (2021-11-01)
 os       Ubuntu 22.04.2 LTS
 system   x86_64, linux-gnu
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2023-03-07
 rstudio  2022.12.0+353 Elsbeth Geranium (desktop)
 pandoc   2.9.2.1 @ /usr/bin/pandoc

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package      * version date (UTC) lib source
 assertthat     0.2.1   2019-03-21 [1] CRAN (R 4.1.2)
 bit            4.0.5   2022-11-15 [1] CRAN (R 4.1.2)
 bit64          4.0.5   2020-08-30 [1] CRAN (R 4.1.2)
 cli            3.6.0   2023-01-09 [1] CRAN (R 4.1.2)
 colorspace     2.1-0   2023-01-23 [1] CRAN (R 4.1.2)
 crayon         1.5.2   2022-09-29 [1] CRAN (R 4.1.2)
 data.table     1.14.8  2023-02-17 [1] CRAN (R 4.1.2)
 dplyr        * 1.1.0   2023-01-29 [1] CRAN (R 4.1.2)
 ellipsis       0.3.2   2021-04-29 [1] CRAN (R 4.1.2)
 fansi          1.0.4   2023-01-22 [1] CRAN (R 4.1.2)
 farver         2.1.1   2022-07-06 [1] CRAN (R 4.1.2)
 forcats      * 1.0.0   2023-01-29 [1] CRAN (R 4.1.2)
 fs             1.6.1   2023-02-06 [1] CRAN (R 4.1.2)
 generics       0.1.3   2022-07-05 [1] CRAN (R 4.1.2)
 GGally         2.1.2   2021-06-21 [1] CRAN (R 4.1.2)
 ggplot2      * 3.4.1   2023-02-10 [1] CRAN (R 4.1.2)
 ggrepel        0.9.3   2023-02-03 [1] CRAN (R 4.1.2)
 ggthemes       4.2.4   2021-01-20 [1] CRAN (R 4.1.2)
 glue           1.6.2   2022-02-24 [1] CRAN (R 4.1.2)
 gtable         0.3.1   2022-09-01 [1] CRAN (R 4.1.2)
 here           1.0.1   2020-12-13 [1] CRAN (R 4.1.2)
 hms            1.1.2   2022-08-19 [1] CRAN (R 4.1.2)
 jsonlite       1.8.4   2022-12-06 [1] CRAN (R 4.1.2)
 knitr          1.42    2023-01-25 [1] CRAN (R 4.1.2)
 labeling       0.4.2   2020-10-20 [1] CRAN (R 4.1.2)
 lattice        0.20-45 2021-09-22 [4] CRAN (R 4.1.1)
 lifecycle      1.0.3   2022-10-07 [1] CRAN (R 4.1.2)
 lubridate    * 1.9.2   2023-02-10 [1] CRAN (R 4.1.2)
 magrittr       2.0.3   2022-03-30 [1] CRAN (R 4.1.2)
 Matrix         1.5-3   2022-11-11 [1] CRAN (R 4.1.2)
 mgcv           1.8-41  2022-10-21 [1] CRAN (R 4.1.2)
 munsell        0.5.0   2018-06-12 [1] CRAN (R 4.1.2)
 nlme           3.1-162 2023-01-31 [1] CRAN (R 4.1.2)
 pak            0.4.0   2023-01-15 [1] CRAN (R 4.1.2)
 paletteer      1.5.0   2022-10-19 [1] CRAN (R 4.1.2)
 patchwork    * 1.1.2   2022-08-19 [1] CRAN (R 4.1.2)
 pillar         1.8.1   2022-08-19 [1] CRAN (R 4.1.2)
 pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.1.2)
 plyr           1.8.8   2022-11-11 [1] CRAN (R 4.1.2)
 png            0.1-8   2022-11-29 [1] CRAN (R 4.1.2)
 prettyunits    1.1.1   2020-01-24 [1] CRAN (R 4.1.2)
 progress       1.2.2   2019-05-16 [1] CRAN (R 4.1.2)
 purrr        * 1.0.1   2023-01-10 [1] CRAN (R 4.1.2)
 R6             2.5.1   2021-08-19 [1] CRAN (R 4.1.2)
 RColorBrewer   1.1-3   2022-04-03 [1] CRAN (R 4.1.2)
 Rcpp           1.0.10  2023-01-22 [1] CRAN (R 4.1.2)
 readr        * 2.1.4   2023-02-10 [1] CRAN (R 4.1.2)
 rematch2       2.1.2   2020-05-01 [1] CRAN (R 4.1.2)
 reshape        0.8.9   2022-04-12 [1] CRAN (R 4.1.2)
 reticulate   * 1.28    2023-01-27 [1] CRAN (R 4.1.2)
 rlang          1.0.6   2022-09-24 [1] CRAN (R 4.1.2)
 rprojroot      2.0.3   2022-04-02 [1] CRAN (R 4.1.2)
 rsconnect      0.8.29  2023-01-09 [1] CRAN (R 4.1.2)
 rstudioapi     0.14    2022-08-22 [1] CRAN (R 4.1.2)
 scales         1.2.1   2022-08-20 [1] CRAN (R 4.1.2)
 sessioninfo    1.2.2   2021-12-06 [1] CRAN (R 4.1.2)
 stringi        1.7.12  2023-01-11 [1] CRAN (R 4.1.2)
 stringr      * 1.5.0   2022-12-02 [1] CRAN (R 4.1.2)
 tibble       * 3.1.8   2022-07-22 [1] CRAN (R 4.1.2)
 tidyr        * 1.3.0   2023-01-24 [1] CRAN (R 4.1.2)
 tidyselect     1.2.0   2022-10-10 [1] CRAN (R 4.1.2)
 tidyverse    * 2.0.0   2023-02-22 [1] CRAN (R 4.1.2)
 timechange     0.2.0   2023-01-11 [1] CRAN (R 4.1.2)
 tzdb           0.3.0   2022-03-28 [1] CRAN (R 4.1.2)
 usethis        2.1.6   2022-05-25 [1] CRAN (R 4.1.2)
 utf8           1.2.3   2023-01-31 [1] CRAN (R 4.1.2)
 vctrs          0.5.2   2023-01-23 [1] CRAN (R 4.1.2)
 vroom          1.6.1   2023-01-22 [1] CRAN (R 4.1.2)
 withr          2.5.0   2022-03-03 [1] CRAN (R 4.1.2)
 xfun           0.37    2023-01-31 [1] CRAN (R 4.1.2)
 yaml           2.3.7   2023-01-23 [1] CRAN (R 4.1.2)

 [1] /home/matias/R/x86_64-pc-linux-gnu-library/4.1
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

─ Python configuration ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 python:         /usr/bin/python3.10
 libpython:      /usr/lib/python3.10/config-3.10-x86_64-linux-gnu/libpython3.10.so
 pythonhome:     //usr://usr
 version:        3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
 numpy:          /usr/lib/python3/dist-packages/numpy
 numpy_version:  1.21.5
 
 NOTE: Python version was forced by use_python function

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
```

### 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.
2023-03-07T17:14:14Z
matiasandina
python-setup
closed
Quarto render using old python lib after upgrade
https://github.com/quarto-dev/quarto-cli/issues/4678