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

Support R interpreters installed via conda #4398

Open
juliasilge opened this issue Aug 19, 2024 Discussed in #4385 · 5 comments
Open

Support R interpreters installed via conda #4398

juliasilge opened this issue Aug 19, 2024 Discussed in #4385 · 5 comments
Labels
enhancement New feature or request lang: r support

Comments

@juliasilge
Copy link
Contributor

Discussed in #4385

Originally posted by ami-null August 18, 2024
From my testing, Positron does not detected R interpreters installed in conda environments. Is it not supported? If not supported, is it planned?

This may be especially important for folks coming to Positron as Python conda users who want to use a little R.

@juliasilge juliasilge added enhancement New feature or request lang: r support labels Aug 19, 2024
@juliasilge
Copy link
Contributor Author

Related to #3724

@juliasilge juliasilge changed the title Support R interpreters installed in via conda Support R interpreters installed via conda Aug 19, 2024
@juliasilge
Copy link
Contributor Author

Maybe we could support an escape hatch via #2235.

@juliasilge juliasilge added this to the Release Candidate milestone Aug 19, 2024
@jennybc
Copy link
Member

jennybc commented Aug 19, 2024

Re: the connection to #2235. I suspect (but have not done the research) that safely using a conda installed R goes beyond identifying the interpreter and also includes doing something about package libraries and repositories. As a non-conda user who has seen a lot of confused issues from conda users who are using R, success depends on committing fully to the conda life and not, for example, trying to use binary packages from CRAN.

@juliasilge
Copy link
Contributor Author

Came up again in #4498

@roaldarbol
Copy link

Just to follow up on your comment @jennybc, I completely agree that there are other related issues, and that a full conda workflow does incur some changes in workflow. However, I and many others are working on making viable workflows that are supported by conda. And Positron is currently in a position to be the IDE of choice for such workflows.
These are the issues I have found, and what is being done currently to address them (that I know of):

  1. Not all CRAN packages are currently on conda-forge. However, most are - there's an amazing group of people doing the amazing work of packaging R packages there. @wolfv from Prefix has been hard at work to make it much easier to add the missing packages to conda channels (repositories) with rattler-build, see https://github.com/wolfv/r-forge. I think a new update of rattler-build that eases this process is not far away.
  2. Package installation from command line. The conda workflow differs from the normal R workflow in that packages are installed from the command line rather than the R console. To address this, I have started a package, {rpix}, which wraps pixi for use within R. And as such, dependencies for both R and Python can be handled with a single tool rather than with conda and renv separately.
  3. Set the correct library. Libraries of course need to be selected for the project. That's where renv has been great, as it's easy to localise the packages inside the project itself! pixi takes the same approach as renv, placing dependencies within each project rather than externally like other conda tools. If Positron could automatically identify a .pixi folder to locate dependencies, that problem would be (partially) solved. As an intermediate solution, I have made a project template that automatically sets the correct R library amongst other R-related goodies, which is then chosen when opening Positron from inside the project.

I'm very happy to help where needed if you need some outside input on conda workflows. Seeing this issue, #3724 and #2659 would, from my point of view go a long way to enable conda-based workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lang: r support
Projects
None yet
Development

No branches or pull requests

3 participants