Skip to content
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

Update conda env docs #959

Merged
merged 4 commits into from
Feb 12, 2024
Merged

Update conda env docs #959

merged 4 commits into from
Feb 12, 2024

Conversation

joelostblom
Copy link
Contributor

Follow up from quarto-dev/quarto#341

@@ -296,7 +296,8 @@ If you need to install Python packages, simply use `pip` or `conda` within the t
## VS Code {#vs-code}

If you create a virtual environment in the `env/` directory as described above, Visual Studio Code should automatically discover that environment when you load a workspace from the environment's parent directory.
Note that this applies only to `venv` not conda environments (which have a separate mechanism for binding to the current VS Code session).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What separate mechanism is referred to here? Is it "select interpreter"?

Comment on lines 299 to 301
Note that this applies only to `venv` not conda environments (which have a separate mechanism for binding to the current VS Code session via the "Select Python Interpreter" option inside VSCode).

Note that this applies only to `venv` not Conda environments (which have a separate mechanism for binding to the current VS Code session).
If you have installed the Quarto executable in a conda environment rather than in a system-wide install, you need to launch VSCode from a terminal with that conda environment activated in order for VSCode to detect the conda installation of Quarto. Although there is a setting in the VSCode extension where you can specify the path to the Quarto executable, this for some reason does not work with Quarto installed in conda environments.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about putting this whole thing starting with "Note that ..." and ending with "installed in conda environments" in a callout block? I tried to do a suggestion, but "Applying suggestions on deleted lines is not supported." :( Also, bolding the word conda within the callout block may help to draw readers' attention to the piece that's relevant to them.

:::{.callout-important}
Stuff about **conda** as an exception to the above instructions here.
:::

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe even this whole sentence could be bolded :)

If you have installed the Quarto executable in a conda environment rather than in a system-wide install, you need to launch VSCode from a terminal with that conda environment activated in order for VSCode to detect the conda installation of Quarto.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I don't think a call out would add that much since this section of the page is already short and easy to overview. But I don't feel strongly about not having it either.

@cderv
Copy link
Collaborator

cderv commented Dec 29, 2023

/deploy-preview

Copy link
Contributor

@cwickham
Copy link
Collaborator

cwickham commented Feb 8, 2024

I think the VS Code section should mirror the RStudio section and use sub-headings for the different environments: venv, condaenv. We probably also need an renv section, but we can handle that.

Then there would seem to be two points in the condaenv section:

  1. How to activate the environment. You mention there is a different mechanism, but the VS Code docs seem to imply that it would be automatic?

    The Python extension automatically detects existing conda environments.

    If it isn't automatic, then I think you should add a short description on how to do it.

  2. You need to activate the environment a special way if the Quarto CLI is installed inside the condaenv. The proposed text looks good. But, could you reword the last sentence to: "The Quarto path setting in the Quarto VSCode extension does not work with Quarto installed in conda environments."?

@joelostblom
Copy link
Contributor Author

Nice to see you again @cwickham 👋 Thanks for the comments! I updated the last sentence to your suggestion. For the activation of the environment; I believe what VS code automates is the detection of all available environments, but you still need to select which env to use via "Select Interpreter" (as in the screenshot in your link). I'm guessing this is what the original sentence was referring to, but if you think it was just referring to how envs were detected, then we could remove the part I added.

@cwickham
Copy link
Collaborator

cwickham commented Feb 12, 2024

👋🏻 nice to see you too @joelostblom

Ah, thanks for the clarification regarding detecting vs. activating the environment. I think in that case we should be explicit about that. I'll make a few direct edits.

@cwickham
Copy link
Collaborator

/deploy-preview

@cwickham
Copy link
Collaborator

cwickham commented Feb 12, 2024

Preview of updated section: Guide > Projects > Virtual Environments: Visual Studio Code

Copy link
Contributor

@cwickham cwickham merged commit f4d45d2 into quarto-dev:main Feb 12, 2024
2 checks passed
@cwickham
Copy link
Collaborator

Thanks @joelostblom and @mfisher87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants