quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
315 stars 26 forks source link

Quarto installation not found when rendering .qmd in VScode on Ubuntu 22.0 #362

Open tvatter opened 8 months ago

tvatter commented 8 months ago

Bug description

The issue is similar to quarto-dev/quarto-cli#5572 (or quarto-dev/quarto-cli#1882): I installed the quarto CLI in a conda environment, which works fine for interactive use and in the VSCode terminal, but which somehow isn't properly detected by the quarto extension when trying to render a doc.

Steps to reproduce

Create the virtual environment with conda env create -f environment.yml, where environment.yml contains the following:

name: intro_to_python
channels:
  - conda-forge
dependencies:
  - python=3.12
  - pylint
  - yapf
  - build
  - jedi
  - unidecode
  - wheel
  - isort
  - ca-certificates
  - openssl
  - numpy
  - scipy
  - matplotlib
  - pandas
  - scikit-learn
  - seaborn
  - ipython
  - jupyter
  - certifi
  - quarto
  - perl

Then activate the created environment and verify that everything works with quarto:

conda activate intro_to_python
quarto check

Use a local .vscode/settings.json at the root of my workspace:

{
  "quarto.path": "path/to/your/envs/intro_to_python/bin/quarto",
}

image /

Expected behavior

I expected the quarto VSCode extension to properly pick-up my quarto CLI install.

Actual behavior

The quarto VSCode extension does not detect my quarto CL install. Note that the same happens if I set "quarto.path" in the User's settings.json instead of the local one.

image

Your environment

VSCode on Ubuntu 22.0

Quarto check output

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.58.3: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /home/tvatter/mambaforge/envs/intro_to_python/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.1 (Conda)
      Path: /home/tvatter/mambaforge/envs/intro_to_python/bin/python
      Jupyter: 5.7.1
      Kernels: python3

(/) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

(\) Checking R installation...........Warning message:
D-Bus service not found!

- If you are in a container environment, please consider adding the
  following to your configuration to silence this warning:

  options(bspm.sudo = TRUE)

- If you are in a desktop/server environment, please remove any 'bspm'
  installation from the user library and force a new system
  installation as follows:

  $ sudo Rscript --vanilla -e 'install.packages("bspm", repos="https://cran.r-project.org")' 
[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /usr/lib/R
      LibPaths:
        - /home/tvatter/R/x86_64-pc-linux-gnu-library/4.3
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.45
      rmarkdown: 2.25

[✓] Checking Knitr engine render......OK
cscheid commented 8 months ago

I think this is a report for quarto-dev/quarto (since that's where the vscode extension is)

memeplex commented 7 months ago

This may be a dup of or related to https://github.com/quarto-dev/quarto/issues/352.

edgBR commented 7 months ago

Hi, I have exactly the same issue and the modification of the quarto path is not helping.

image

image

However:

image

The command line works perfectly

edgBR commented 7 months ago

Hi any comments on this? @memeplex @cscheid @cderv

tvatter commented 7 months ago

@cscheid any idea what might be going on and how to solve it ?

edgBR commented 6 months ago

Hello,

Im still having the same problem.

Is there a fix planned to this?

BR E

obiii commented 6 months ago

Hi,

I'm facing the same problem where the Quarto VSCode extension isn't recognizing my Quarto CLI installation, even after adjusting the Quarto path.

Is there any update on this please?

dawnmy commented 5 months ago

Hi,

I'm facing the same problem where the Quarto VSCode extension isn't recognizing my Quarto CLI installation, even after adjusting the Quarto path.

Is there any update on this please?

Same here with quarto extension v1.111.0 and quarto 1.4.550. Installed quarto with conda, and set the path in vscode quarto settings, but it still loads an old version quarto from Rstudio which is not compatible with the extension.

cscheid commented 5 months ago

it still loads an old version quarto from Rstudio which is not compatible with the extension.

That means something is setting your PATH env variable to that version of Quarto. The extension simply looks at the PATH and at the VS code configuration variables.

adibafandia commented 5 months ago

it still loads an old version quarto from Rstudio which is not compatible with the extension.

That means something is setting your PATH env variable to that version of Quarto. The extension simply looks at the PATH and at the VS code configuration variables.

I think that something is quarto itself: https://github.com/quarto-dev/quarto/blob/3bd070a1ffabd0b2dc80c67f5d9fa9a2d8bee896/packages/quarto-core/src/context.ts#L195

I am having the same problem and still figuring out. I am working remotely with vscode. My PATH env has "/usr/lib/rstudio-server/bin/quarto/bin" attached to it inside vscode integrated terminal. But with normal ssh, my vanilla PATH has none. Setting quarto.path (to my preferred quarto version) manually has no effect just like OP.

cscheid commented 5 months ago

I think that something is quarto itself:

Not quite. I wasn't accurate in my statement above (I apologize!), but this scanning only happens in case the install on the path isn't found:

https://github.com/quarto-dev/quarto/blob/3bd070a1ffabd0b2dc80c67f5d9fa9a2d8bee896/packages/quarto-core/src/context.ts#L53C1-L62C1

Calling detectQuarto("quarto") attempts to run quarto directly from execProgram, which does use the path.

AlbertoFabbri93 commented 4 months ago

How can we help to further debug this? Quarto is on the path when the conda environment is activated but it is not detected by the extension...

cderv commented 4 months ago

How can we help to further debug this?

As you are asking, I am taking this opportunity :)

As this is environment specific (Unbutu + conda + ...), it would be quite helpful to have a devcontainer configuration for a reproducible example we could easily dig into on our side. devcontainer integrates well with VSCODE too, so it would help. Any environment like codespace works too - they also use devcontainer spec.

Possibly a docker image (or DOCKERFILE) to use with all the setup done would be helpful too otherwise.

This would really be helpful to us as it would save us time to recreate the situation so that we can look for the problem sooner.

Otherwise, this issue just need to wait for our priority to go down on quarto 1.5 next release to have the right amount of time to look into that.

Generally, we welcome any contribution that would help pinpoint the exact issue here.

Thanks to anyone willing to give it a spin :)