Skip to content

Commit 7e3173f

Browse files
authored
[vscode] Install and setup R kernel for jupyter-notebooks (#276)
* [vscode] install jupyter-client and R kernel for notebooks * Checking for pip before installing R jupyter kernel
1 parent 126d42c commit 7e3173f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

vscode/scripts/install-vscode-extensions.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ r_extensions=(
5757
"RDebugger.r-debugger"
5858
)
5959
if command -v R &> /dev/null; then
60+
# Install R kernel for jupyter notebooks
61+
if command -v pip &>/dev/null; then
62+
# First install the minimal jupyter-client python package to make R kernel available to jupyter notebooks
63+
if command -v uv &>/dev/null; then
64+
uv pip install --system --no-cache jupyter-client
65+
else
66+
pip install --no-cache-dir jupyter-client
67+
fi
68+
R -e "install.packages('IRkernel'); IRkernel::installspec()"
69+
fi
6070
for extension in "${r_extensions[@]}"; do
6171
install_extension $extension
6272
done

0 commit comments

Comments
 (0)