Closed roaldarbol closed 4 months ago
Sounds good and thanks for opening this issue..
I'm literally working on this right now, not sure how best to progress and would be happy to do a quick call to show you my use case ☎️
Or can keep reporting progress here...
Basically this is what I'm hitting:
Guess I need to set the R path to the pixi install?
which R
/workspaces/netgen/.pixi/envs/default/bin/R
Yeah, just report here - I can try to tidy up the issues along the way. I might not be able to respond super quickly as I'm also writing like crazy on my PhD. :P
Yeah, so this is basically the issue I opened on Positron too - there's no good way I know of to discover project/environment-based R installations at present. I opened https://github.com/roaldarbol/r-template/issues/4 to follow it.
Currently looking at adding this to .devcontainer.json:
"settings": {
"r.rpath.linux": "/workspaces/netgen/.pixi/envs/default/bin/R"
},
"when": "devcontainer"
},
What I would do is either use RStudio for now (...), or use Jupyter with an R kernel. I'll make a new issue adding the needed Jupyter components to the template. 😊
What I would do is either use RStudio for now (...), or use Jupyter with an R kernel. I'll make a new issue adding the needed Jupyter components to the template. 😊
Issue is I'm developing inside a .devcontainer. I think RStudio can work with GitHub codespaces but not sure how to spin that up ATM.
Currently looking at adding this to .devcontainer.json:
"settings": { "r.rpath.linux": "/workspaces/netgen/.pixi/envs/default/bin/R" }, "when": "devcontainer" },
Please keep me updated on #4, would be great to find a solution to it.
Do you need to run a script or do you need the console?
If you need to run a script, you could run it with pixi run Rscript myscript.R
Need in console for interactive development, e.g. in Quarto doc (primary way of working on interactive data analysis).
Another observation after trying to run R from the installed path, without pixi shell
:
/workspaces/netgen/.pixi/envs/default/bin/R
R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-conda-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_MONETARY failed, using "C"
6: Setting LC_PAPER failed, using "C"
7: Setting LC_MEASUREMENT failed, using "C"
*** caught segfault ***
address (nil), cause 'memory not mapped'
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Segmentation fault (core dumped)
This seems to be the solution for VS Code, meaning everything gets installed globally:
pixi global install netgen
Next issue (sorry @roaldarbol and no expectation for quick response):
pixi global install netgen
⚠️No executable entrypoint found in package netgen, are you sure it exists?
✔ Installed package netgen 6.2.2006 py310h6db9624_4 from conda-forge
root@codespaces-f59edc:/workspaces/netgen# R
bash: R: command not found
Do I need to add an entrypoint?
No, so by installing globally, you're installing where there's no R installation - the two things are completely walled off from each other. So I don't think global install
is what you want. This seems to be a Docker related issue, can't help much with that unfortunately. Found something on SO: https://stackoverflow.com/a/17510093/13240268
No luck with pixi global install
which I tried first:
pixi global install
Installs the defined package in a global accessible location
Usage: pixi global install [OPTIONS] [PACKAGE]...
Closing this issue as the template now asks for and incorporates platform.
Until there's a better solution where we can rely on the pixi fetching of the platform, just ask the user which platform they're on.