How to install Scala in Jupyter IPython Notebook?

Here are a few links that I went to and did what they said. I do not know what I am doing wrong.

https://github.com/alexarchambault/jupyter-scala https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages https://github.com/apache/incubator-toree http://jcrudy.imtqy.com/blog/html/2013/12/08/introduction_to_iscala.html 

None of this works. It is possible that my node is configured. I just do not know. Please help. Thanks!

+7
source share
5 answers

You can use the information provided here .

Make sure IPython 3 is installed. Ipython --version should return> = 3.0. If this is not the case, a quick way to configure it is to install the Anaconda Python distribution and then run it

$ pip install --upgrade "ipython[all]"

Then ipython --version should return the value> = 3.0.

Download the Jupyter Scala binaries for Scala 2.10 ( txz or zip ) or Scala 2.11 ( txz or zip ) and unzip them to a safe place. Then run the jupyter-scala program (or jupyter-scala.bat on Windows) that it contains. This will configure the Jupyter Scala kernel for the current user.

Verify that Jupyter / IPython knows about Jupyter Scala by running

$ jupyter kernelspec list

This should print, among other things, the line as

scala211

(or scala210 depending on the version of Scala you choose).

Then start the IPython console with

$ ipython console --kernel scala211

and immediately start using the Jupyter Scala core or launch the Jupyter Notebook with

$ jupyter notebook

and create Scala 2.11 notebooks by selecting Scala 2.11 from the drop-down menu in the upper right corner of the Jupyter Notebook start page.

Note. Since IPython is now replaced by Jupyter, we replaced ipython in the above commands with jupyter .

+13
source

The answer for Linux can be found here .

Install Scala. Add these lines to ~ / .bashrc

export SCALA_HOME = / usr / local / share / scala export PATH = $ PATH: $ SCALA_HOME / bin: $ PATH Follow these instructions from the GitHub website:

Download and unzip the pre-packaged Scala 2.11 binaries. Unzip each downloaded archive (s), and, from the console, go to the trash subdirectory of the directory that it contains. Then do the following: install the appropriate Scala kernel:

./jove- scala --kernel-spec

+1
source

I tried the following with a Jupyterhub laptop and it works without problems:

 # Step 1: Install spylon kernel pip install spylon-kernel # Step 2: create a kernel spec python -m spylon_kernel install # Step 3: start jupyter notebook jupyter notebook 

PS: to view a list of all installed kernels, you can run the following command:

 jupyter kernelspec list 
+1
source

Has anyone tried https://github.com/almond-sh/almond

It seems to be actively contributing

0
source

I cannot add a comment to Heapify's answer, but its solution worked for JupyterLab on Windows without problems.

I cut and pasted its code into the Anaconda Powershell tooltip

 pip install spylon-kernel python -m spylon_kernel install jupyter notebook 

And updated my anacopnda launcher and a spylon project option was available.

0
source

Source: https://habr.com/ru/post/1243610/


All Articles