1
3

More than 3 years have passed since last update.

[mac] pyenv+Jupyter-Lab環境にRをインストールする

Last updated at Posted at 2020-12-24

目的

  • pyenv環境で起動したJupyter Lab上で、Rを利用できるようにする

動作確認環境

  • macOS Big Sur (version 11.1)
  • Jupyter Core : 4.6.3
  • Jupyter Lab : 2.2.8
  • R : 4.0.3

前提条件

  • Jupyter, Jupyter Labがインストールされていること

インストール手順

HomebrewでRをパッケージインストールします。

% brew casc install r

インストール先のpyenv環境を有効化し、ターミナルからRのコンソールを起動します。

% pyenv local testenv
(testenv) % R
---
R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20.1.0 (64-bit)

(...略...)

> 

IRkernelをインストールし、カーネルの登録を行います。

> install.packages('IRkernel')
> IRkernel::installspec()

Jupyter Labを起動し、Rカーネルが利用可能になっていることを確認します。

スクリーンショット 2020-12-24 9.36.16.png

関連記事

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3