Comments (5)
Can anybody please let me know if this is something that can be adressed?
from vscode-r.
Have you seen https://github.com/REditorSupport/vscode-R/wiki/Working-with-renv-enabled-projects?
from vscode-r.
Thank you for the reply @eitsupi.
I have a renv library /project/renv/library/R-4.2/x86_64-pc-linux-gnu
. within that library languageserver and jsonlite are installed and that library is included within r.libPaths
.
The problem that I have is that when I launch R from VSCode I cannot load any of the libraries which is within /project/renv/library/R-4.2/x86_64-pc-linux-gnu
. I get the error mentioned above.
If i start the R terminal outside the VSCode I can normally load those libraries.
The problem in my opinion is how R is started within VSCode and outside.
Outside of VSCode:
> Sys.getenv("PATH")
[1] "/opt/bwhpc/common/compiler/gnu/12.1.0/bin:/opt/bwhpc/common/math/R/4.2.1-mkl-2022.2-gnu-12.1-cairo/bin:/home/hd/hd_hd/hd_ut239/.local/bin:/home/hd/hd_hd/hd_ut239/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/hd/hd_hd/hd_ut239/bin/cmake-3.25.2-linux-x86_64/bin"
Within VSCode:
> Sys.getenv("PATH")
[1] "/gpfs/bwfor/home/hd/hd_hd/hd_ut239/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/bin/remote-cli:/home/hd/hd_hd/hd_ut239/.local/bin:/home/hd/hd_hd/hd_ut239/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/hd/hd_hd/hd_ut239/bin/cmake-3.25.2-linux-x86_64/bin/:/home/hd/hd_hd/hd_ut239/bin/cmake-3.25.2-linux-x86_64/bin/"
I am using VSCode to connect remotly to HPC. Within HPC, R is available as module, when i module load R
it loads R but in addition it also load compiler/gnu/12.1
and numlib/mkl/2022.2
. I have an impression that those additional modules are causing problem in VScode.
Any help would be greatly appreciated.
Regards,
Amel
from vscode-r.
@renkun-ken would you mind having a look into this?
from vscode-r.
I have no idea what the "correct" solution is here but the following workaround seems to work for me:
- Create the file in your project
./bin/loadR.sh
- Populate the file with what ever commands are needed to load the correct module environment + environment variables e.g.
module load R
export LD_LIBRARY_PATH=<what ever you need>
R $@
- Make the script executable
chmod 755 ./bin/loadR.sh
- Update your local project specific settings file (
./.vscode/settings.json
) to launch R using this script
{
"r.rterm.linux": "${workspaceFolder}/bin/loadR.sh"
}
When you then attach R via the command pallete this should have the correct environment set up.
from vscode-r.
Related Issues (20)
- Run line of code (or chunk) by Ctrl + Enter and automatically include entire chunk, advancing cursor to the next line / chunk HOT 3
- No response after clicking R: (not attached) HOT 6
- plot in External browser trigger error of “useMethod” HOT 4
- Support for R available as module on Red hat remote
- LS highlighting in Terminal with Radian? HOT 1
- Installing required packages fails if the system library is not writable and the user has no library
- terminal R studio HOT 2
- Issue with pkg `rstudioapi` after updating to R 4.4 HOT 4
- CI for macOS and windows always fails
- Add package's own `inst/include` with "Generate C/C++ configuration"...
- Extension behaving oddly when file is part of VSCode workspace
- The wiki statement conflicts with the actual situation, about how to configure radian HOT 1
- Option to open R console in split editor window HOT 1
- Run command in Terminal errors with "Cannot read properties of undefined (reading 'replace')"
- Can I view data through keyboard shortcuts? HOT 2
- Can't assign R path
- Help page not available on remote SSH to windows HOT 1
- On Windows and MacOS, `source()`ed packages do not show function suggestion even Namespaces attached and loaded
- PR Request for the Wiki: Added additional info on installation and lintr HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-r.