-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarto installed via conda can't see jupyterlab and does not work with the vscode extension #341
Comments
cc @mfisher87 in case you encountered this type of issue in the past with the conda Quarto package For reference, Quarto conda package lives there: https://github.com/conda-forge/quarto-feedstock |
Quarto + Jupyter in conda envI'm not seeing this problem. Is it occurring entirely without the involvement of VSCode?
If this is occurring outside of a VSCode context, please create a new issue over on the feedstock repo and we'll work together to try and figure it out :) If you're using a Bourne-incompatible shell (i.e. VSCodeI know very little about VSCode, I apologize. This could be related to this sticky issue on our feedstock: conda-forge/quarto-feedstock#30 What I'd naively expect from VSCode is that it only needs to know which conda environment to activate, and then from there If VSCode is not activating your Quarto environment in the supported way (using a Bourne-compatible shell), then when it tries to run the Quarto script at its exact path, the correct envvars won't be set and it will fail. It looks like you have Quarto installed correctly outside the VSCode context, so this is unfortunately my best guess. VSCode may simply be reporting "Quarto is not installed" because it's trying a Anyone know how to check what's actually happening under VSCode's covers? |
Thanks @mfisher87 ! I do see this outside vscode, and my shell is zsh so the For the vscode part, my understanding is that I only need to set up the path to the quarto executable (that's what the quarto docs say at least) and not do anything else with my conda env. For jupyternotebooks, vscodes provides a mechanism to associate a conda kernel with the notebook, but I don't see that quarto provides anything similar. I tried setting the path in the options do the base dir of the environment, but I get an error message saying it needs to be the path to the quarto executable. |
One more note is that although the terminal inside (and outside) vscode does not find |
I believe the Quarto dev team doesn't have very many Conda users, so if there are caveats dealing with how Quarto+VSCode+Conda work together, I think it's on folks like us to help contribute that information to the docs. Would you feel comfortable opening a PR to improve the docs? Are you using a Quarto extension in VSCode or is this a built-in feature? If the former, perhaps we should loop another GitHub repository in to this discussion; it may be that the extension needs to be able to be conda-aware like the Jupyter extension you mentioned. |
I'm happy to PR the docs if it is confirmed that the "correct" way to use quarto with conda is that we shouldn't use the I am using the official quarto extension for VS Code. I believe this is the repo to file issues for that extension, but happy to open it somewhere else if that is not the case |
Good point. I thought I was in the quarto-cli repo 😆 |
Circling back from investigation in conda-forge/quarto-feedstock#34: The issue is |
About this jupyter_core change we did an adaptation in Quarto recently Regarding documentation, current about conda is at https://quarto.org/docs/projects/virtual-environments.html#using-conda But this is about conda environment for python and jupyter and not directly the Conda installed Quarto. Though both are related probably. Activating conda environment to run the tools install in it seems a common practice though 🤔 We always welcome PR to the documentation (https://github.com/quarto-dev/quarto-web) |
Yes, found that! Can that fix be backported to 1.3.x?
I was more wondering if there are any gotchas with the VSCode-Conda-Quarto combination that should be called out in the Quarto-VSCode docs? I think based on what we've found, that's not the solution, the solution is to get this issue resolves. |
I made a follow up PR in quarto-dev/quarto-web#959
I don't think it is for VSCode. The most common workflow I see is to launch vscode from the system's program launcher/start menu and then activate different conda environments via "Select Python Interpreter" for both python scripts and jupyter notebooks. It is convenient to launch VS this way since you have access to all conda kernels and can have multiple files open with different kernels. This workflow still works with quarto documents, but it only switches the python packages and not the quarto executable. I think this actually makes sense since we would want to hook up different kernels to use with quarto without having quarto installed in each one of them. The most confusing part to me currently is that there is an option in the VSCode extension to set the quarto path and that option does not seem to work (at least not for quarto installed in conda envs); if this option worked then VSCode could be launched from the program launcher and then still see quarto wherever it was installed on the system, which to me is the expected behavior and how I have worked with other vscode installations that allow specification to a binary file (e.g. the neovim extension). |
It seems like quarto installed via conda does not recognize jupyter/jupyterlab installation in the same environment. See screenshot:
I have seen that I can set the
QUARTO_PYTHON
env variable but I would like quarto to automatically use the python version in the conda env where quarto is installed (ie read path instead of setting its own python version)It also seems like VScode cannot detect this version of quarto although I have specified the full path in the settings:
When I try to render, it says "quarto not found".
I can work around this issue by launching vscode from a terminal where the conda env has already been activated but that seems to be defeating the purpose of having the setting to set the explicit quarto path
The text was updated successfully, but these errors were encountered: