Isak Baizley
Isak Baizley

Reputation: 1843

R and Julia Kernels not available in Jupyter notebook

I recently installed the Anaconda3 distribution and I want to have the R and Julia Kernels available besides Python. I use windows 10.

To install IJulia I installed the Julia language and follewed the steps indicated in the IJulia page; everything went fine.

To install the R kernel I used the command conda install -c r r-essentials in the anaconda command prompt, again, no problems. I also installed R.

When I launch the notebook the only available kernel is Python, the R and Julia kernels doesn't appear in the list, I have no clue why this since I got no errors in the installation of IJulia and IRKernel. Anyone could help?

Upvotes: 12

Views: 13119

Answers (2)

Excellent, it worked. However, it is important to import the package first before adding it.

import Pkg; Pkg.add("IJulia")

Upvotes: 1

Sushant Rajbanshi
Sushant Rajbanshi

Reputation: 2010

After a fresh installation of Anaconda Distribution (either 2 or 3), following steps should be performed to achieve the desired kernels (R & Julia) on your notebook.

To install R on Anaconda(2/3) Jupyter Notebook :

  1. Open 'Anaconda Command Prompt' & execute conda update notebook to update your Jupyter notebook to the most recent version.
  2. Then install IRkernel by conda install -c r notebook r-irkernel
  3. Now you may open R in your command prompt by running R.exe
  4. Install all necessary R packages using the following lines in the R console by executing :

    install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))

    devtools::install_github('IRkernel/IRkernel')

  5. Finally, make the R kernel available to your Jupyter Notebook by executing:

    Install only for the current userIRkernel::installspec()

    For System-wide installation(all Users)IRkernel::installspec(user = FALSE)

To install Julia on Anaconda(2/3) Jupyter Notebook :

  1. First, download Julia version 0.4 or later and run the installer. Then run the Julia application (double-click on it); the Julia Console with a julia> prompt will appear.
  2. Now, for the most important step, open 'Anaconda Command Prompt' & execute where jupyter to see the actual path of your Jupyter Notebook. The output will be something like "C:\Users\JohnDoe\AppData\Local\Continuum\Anaconda3\bin\jupyter.exe"
  3. Copy the above location and go to your Julia console. Now, execute the following respectively: ENV["JUPYTER"]="C:\\Users\\JohnDoe\\AppData\\Local\\Continuum\\Anaconda3\\bin\\jupyter.exe"

    Pkg.add("IJulia")

    Pkg.build("IJulia") (Optional, execute if further error occurs again.)

    Notice that the backslashes have to be doubled when you type them as a Julia string. I've just assumed that the path is your Anaconda path with \bin\jupyter appended, but replace that with whatever where jupyter tells you.

  4. After few minutes, in Julia console execute:

    using IJulia
    notebook()

Now, you can program Julia in your Anaconda Jupyter Notebook.

Upvotes: 15

Related Questions