quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.99k stars 328 forks source link

Resolving Missing pandoc Symlink in Quarto Installed via Pixi Environment #11583

Open laguill opened 1 day ago

laguill commented 1 day ago

Hello, I wanted to share an issue I faced while using Quarto in a Pixi environment on Ubuntu.

The Issue

When Quarto is installed in a Pixi environment, the required pandoc symlink is missing. This causes issues with the Quarto VS Code extension, as the visual editing mode relies on pandoc being available at a specific path (/opt/quarto/bin/tools/pandoc).

Solution Overview

To resolve this, you need to create a manual symlink for pandoc in the appropriate directory. Below is a step-by-step guide.

Step-by-Step Solution

  1. Determine System Architecture Use the uname -m command to identify your system's architecture. This is necessary because the location for the pandoc binary depends on whether you're using x86_64 (64-bit Intel/AMD) or aarch64 (ARM).x86_64 architecture or aarch64 you have to add symlink manually
  2. Use the $CONDA_PREFIX Environment Variable The $CONDA_PREFIX variable points to the root directory of your active Conda environment. We'll use it to construct the paths dynamically, ensuring compatibility across environments.
  3. Create the Required Path Before creating the symlink, ensure the target directory exists. Create the tools/<architecture> directory if it doesn't already exist:

      mkdir -p $CONDA_PREFIX/bin/tools/$(uname -m)/

    The -p flag ensures that intermediate directories are created if needed.

  4. Create the Symlink Link the pandoc binary from $CONDA_PREFIX/bin to the architecture-specific path under tools:

      ln -s $CONDA_PREFIX/bin/pandoc $CONDA_PREFIX/bin/tools/$(uname -m)/pandoc

    This ensures that tools looking for pandoc in the architecture-specific directory can find it.

  5. Commands summary

      # Determine system architecture
      uname -m
    
      # Create path to pandoc symlink before adding it
      mkdir -p $CONDA_PREFIX/bin/tools/$(uname -m)/
    
      # Create the symlink
      ln -s $CONDA_PREFIX/bin/pandoc $CONDA_PREFIX/bin/tools/$(uname -m)/pandoc
mcanouil commented 12 hours ago

Could you elaborate on how you install Quarto exactly?

And are you reporting an issue or actually reporting a way to solve one for an unofficial install of Quarto? GitHub Issues are for bug reports, whilst GitHub Discussions are preferred for discussions. (Don't open a new one, we can convert/transfer)

Note that the official packaged version of Quarto are listed on GitHub release: https://github.com/quarto-dev/quarto-cli/releases/tag/v1.6.39

Conda recipe for instance is not (really) maintain by Quarto team.

For instance for the current stable release, the official and supported installers are: