5

I'm running RHEL 6.7, and have Anaconda set up. (anaconda 4.10). Jupyter is working OOTB, and it by default has the Python kernel. Everything is dandy so I can select "python notebook" in Jupyter.

I'm now looking to get Scala set up with Jupyter as well. (which it seems like Spark kernel - now Toree will work?)

Every question/answer I've seen in regards to it - is not referencing the issue I'm running into.

I was trying to install Toree, and did

sudo pip install toree 

and it worked. But then the next step is too

jupyter toree install

And the error I get is:

jupyter toree install
Traceback (most recent call last):
  File "/usr/app/anaconda/bin/jupyter-toree", line 7, in <module>
    from toree.toreeapp import main
ImportError: No module named toree.toreeapp

Am I missing a step? Anything I'm doing wrong? If i need to provide more information, I will be glad too. Thanks!

Edit: What is the standard/easiest/reliable way to get a Scala notebook in Jupyter? (tl;dr)

Thomas K
  • 39,200
  • 7
  • 84
  • 86
robromo
  • 321
  • 1
  • 4
  • 15

3 Answers3

2

If you are trying to get spark 2.0 with 2.11 you may get strange msgs. You need to update to latest toree 0.2.0 For Ubuntu 16.04 64bit. I have package & tgz file in https://anaconda.org/hyoon/toree

That's for python 2.7 & you will need conda. If you don't know how, then just download tgz then

tar zxvf toree-0.2.0.dev1.tar.gz
pip install -e toree-0.2.0.dev1

And I prefer to:

jupyter toree install --interpreters=Scala --spark_home=/opt/spark --user --kernel_name=apache_toree --interpreters=PySpark,SparkR,Scala,SQL

Which will create kernels in ~/.local/share/jupyter/kernels (--user is the key)

Happy sparking!

Derlin
  • 9,572
  • 2
  • 32
  • 53
user6273920
  • 713
  • 1
  • 7
  • 16
0

First, make sure you set the SPARK_HOME variable in your shell environment to point to where spark is located, for example:

export SPARK_HOME=$HOME/Downloads/spark-2.0.0-bin-hadoop2.7

next install toree with

sudo jupyter toree install --spark_home=$SPARK_HOME
7kemZmani
  • 658
  • 1
  • 8
  • 21
  • 1
    I don't think this is required just to use, but to actually develop on Torre... "This means that you need to install sbt, jupyter/ipython, and other development requirements locally on your machine." `make release` is probably better, but even that requires Docker – OneCricketeer Sep 18 '16 at 04:56
  • 1
    I assumed that the OP has already gone through the github page and red the requirements, so here I just described the "easiest" way of getting Apache Toree up and running as he asked. – 7kemZmani Sep 18 '16 at 22:35
  • I don't have docker, I wasn't planning on getting it just to use Toree - unless of course it is needed, I definitely thought I saw instructions without Docker, but maybe not. Following the main site: https://toree.incubator.apache.org/documentation/user/quick-start, is when I get the issue in question...the error: "ImportError: No module name toree.toreeapp" after running the second command, "jupyter toree install --spark_home=/usr/local/bin/apache-spark/" – robromo Sep 19 '16 at 14:31
  • you don't need to have docker running, the two commands I posted here worked perfectly for me. You should note that the project is still is in its infancy even though it started three years ago, so until a binary releases come out, the two commands here should suffice. – 7kemZmani Sep 19 '16 at 23:54
  • Got it - didn't know that. Trying it now, and I succesfully cloned the repo, but then if I run the 'make dev' in the directory, it gives me a 'make: docker: command not founder' and if i run it in my home where the directory exists, I get 'make: *** No rule to make target dev' (which I'm assuming is since I'm not pointing it anywhere?) – robromo Sep 20 '16 at 12:53
  • forget about 'make dev' ... the updated answer now should work – 7kemZmani Sep 21 '16 at 08:57
  • I got this error. http://stackoverflow.com/questions/40700347/apache-toree-and-spark-scala-not-working-in-jupyter appreciate the help. thanks – Ming Nov 20 '16 at 16:50
0

The following worked for me (with conda 4.2.13):

conda install -c creditx toree

Then,

jupyter toree install --spark_home=/home/crocefisso/Softs/spark-2.0.0-bin-hadoop2.7 --user

where /home/crocefisso/Softs/spark-2.0.0-bin-hadoop2.7 is where I put Spark

crocefisso
  • 793
  • 2
  • 14
  • 29