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

Interpreters in miniforge are not detected #3791

Closed
aldotapia opened this issue Jul 2, 2024 · 8 comments
Closed

Interpreters in miniforge are not detected #3791

aldotapia opened this issue Jul 2, 2024 · 8 comments
Labels
bug Something isn't working lang: r

Comments

@aldotapia
Copy link

Positron Version: 2024.06.1 (Universal) build 27 / OS: Darwin x64 23.4.0

Steps to reproduce the issue:

  1. Open Positron
  2. Creck interpreters

What did you expect to happen?

Identify R installation and activate the R interpreter, Since I have R 4.4.1 installed

Were there any error messages in the output or Developer Tools console?

There are no error messages in either output or console. I can only see Python interpreters:

Captura de pantalla 2024-07-01 a la(s) 8 17 12 p  m
@aldotapia aldotapia added the bug Something isn't working label Jul 2, 2024
@juliasilge
Copy link
Contributor

Can you look in the Positron R Extension output channel and share what you see there?

r-ext-logs

You can even attach the whole file here as a .log file if you do "Open Output in Editor" and then find/save the file.

@aldotapia
Copy link
Author

Sure, it's the following:

2024-07-01 23:48:29.590 [info] Log level: Debug
2024-07-01 23:48:29.590 [info] Refreshing testthat status
2024-07-01 23:48:29.590 [info] Not working in an R package
2024-07-01 23:48:29.590 [info] Context key 'testthatIsConfigured' is 'false'
2024-07-01 23:48:29.591 [info] Context key 'testthatHasTests' is 'false'
2024-07-01 23:48:29.594 [info] Resolved R binary at /Users/aldotapia/miniforge3/bin/R
2024-07-01 23:48:29.600 [info] Candidate R binary at /Users/aldotapia/miniforge3/bin/R
2024-07-01 23:48:29.600 [info] R installation discovered: {
  "valid": true,
  "supported": false,
  "binpath": "/Users/aldotapia/miniforge3/bin/R",
  "homepath": "/Users/aldotapia/miniforge3/lib/R",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.1.2",
    "major": 4,
    "minor": 1,
    "patch": 2,
    "prerelease": [],
    "build": [],
    "version": "4.1.2"
  },
  "version": "4.1.2",
  "arch": "x86_64",
  "current": true,
  "orthogonal": true
}
2024-07-01 23:48:29.600 [info] Candidate R binary at /Library/Frameworks/R.framework/Versions/4.2/Resources/bin/R
2024-07-01 23:48:29.600 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "/Library/Frameworks/R.framework/Versions/4.2/Resources/bin/R",
  "homepath": "/Library/Frameworks/R.framework/Resources",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.4.1",
    "major": 4,
    "minor": 4,
    "patch": 1,
    "prerelease": [],
    "build": [],
    "version": "4.4.1"
  },
  "version": "4.4.1",
  "arch": "x86_64",
  "current": false,
  "orthogonal": false
}
2024-07-01 23:48:29.600 [info] Candidate R binary at /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/bin/R
2024-07-01 23:48:29.600 [info] R installation discovered: {
  "valid": true,
  "supported": true,
  "binpath": "/Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/bin/R",
  "homepath": "/Library/Frameworks/R.framework/Resources",
  "semVersion": {
    "options": {},
    "loose": false,
    "includePrerelease": false,
    "raw": "4.4.1",
    "major": 4,
    "minor": 4,
    "patch": 1,
    "prerelease": [],
    "build": [],
    "version": "4.4.1"
  },
  "version": "4.4.1",
  "arch": "x86_64",
  "current": false,
  "orthogonal": false
}
2024-07-01 23:48:29.600 [info] Filtering out /Library/Frameworks/R.framework/Versions/4.2/Resources/bin/R: not current and also not orthogonal.
2024-07-01 23:48:29.600 [info] Filtering out /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/bin/R: not current and also not orthogonal.
2024-07-01 23:48:29.600 [info] Filtering out /Users/aldotapia/miniforge3/bin/R: version is < 4.2.0

Perhaps conda R version is conflicting here, since R Extension found R v4.4

@aldotapia
Copy link
Author

Positron detected R after uninstalling r-base from miniforge3 base env (yes, my bad). I don't know if I should close this issue, since now I'm looking at Python interpreters detected and the only one that shows up from miniconda3 is the base environment (I have 19 miniforge3 environments). I even set up the default Python interpreter to one of them (/Users/aldotapia/miniforge3/envs/ads for example) and when I restart Positron it changes to ~/.pyenv/versions/3.8.16/bin.

I have no issues with anaconda3 or pyenv, so I suspect it's related to miniforge3

@roaldarbol
Copy link

I think this issue is worthwhile keeping open - might need a renaming though. To me the issue seems that Positron isn't supporting the r-base installation, which is a pity since it's a great way of having a reproducible environment. So ensuring that other R installations are discoverable, also conda installations.

For the Python interpreters, Positron uses the vscode-python extension, and they might be having some issues with miniforge3 (microsoft/vscode-python#23655) (and do not currently support micromamba yet (microsoft/vscode-python#20919 (comment))). So on the Python side I'd direct an issue there. :-)

@wesm
Copy link
Contributor

wesm commented Jul 2, 2024

I also use miniforge3 so I agree that we should make Positron robust to discovering both R and Python environments originating out of conda-forge (even if they're installed in the base environment)

@aldotapia aldotapia changed the title Positron can't discover R in macOS Interpreters in miniforge are not detected Jul 2, 2024
@lionel-
Copy link
Contributor

lionel- commented Jul 2, 2024

Can you try installing R >= 4.2 on miniforge? I think the one currently installed doesn't show up because it's an unsupported version:

Filtering out /Users/aldotapia/miniforge3/bin/R: version is < 4.2.0

@lionel-
Copy link
Contributor

lionel- commented Jul 2, 2024

So your current installation is the miniforge R, which is unsupported because it's < 4.2.

Then you have two other installations which are neither current nor orthogonal (which means they are not safe to run if not current), which were also discarded during discovery.

Besides installing a newer version of R on miniforge, you can also make your other installations of R orthogonal by running

rig system make-orthogonal 

See https://github.com/r-lib/rig for how to install rig. This would at least allow Positron to run these other installations of R that meet the version requirement.

We plan to make it easier to understand what's going on when an install of R is unsupported, see #1397

@jennybc
Copy link
Member

jennybc commented Jul 2, 2024

We've figured out that positron-r is behaving as intended here and, specifically, that we can discover an interpreter in miniforge. The problem is that the intersection of supported R installations (version >= 4.2) and "usable" installation (either the current version of R or a so-called orthogonal R installation) is the empty set right now on this user's system.

@jennybc jennybc closed this as completed Jul 2, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working lang: r
Projects
None yet
Development

No branches or pull requests

6 participants