5

I want to use anaconda in zeppelin.

So I modify the configure file in /zeppelin/conf/zeppelin-env.sh like below.

export SPARK_HOME=/home/jin/spark
export PYTHONPATH=/home/jin/anaconda3/bin/python
export PYSPARK_PYTHON=/home/jin/spark/python

Because I think when I modified the PYTHONPATH then I could use the anaconda version.

https://zeppelin.apache.org/docs/0.6.2/interpreter/python.html

Path of the already installed Python binary (could be python2 or python3).
If python is not in your $PATH you can set the absolute directory 
(example :/usr/bin/python)

But python version doesn't be changed. I try to check the python version in zeppelin notebook.

%python

import sys

print(sys.version)
print(sys.version_info)


2.7.12 (default, Nov 19 2016, 06:48:10) 

How can I use anaconda in zeppelin?

Bethlee
  • 825
  • 3
  • 17
  • 28
  • I don't know anything about zeppelin, but according to these docs, you're pretty close: http://zeppelin.apache.org/docs/latest/interpreter/python.html#conda – Paul H Feb 23 '17 at 04:55
  • Thank you for answering. When I change the .bashrc to add anaconda path, it works. But I don't want to modify .bashrc so I try using python.conda. – Bethlee Feb 23 '17 at 08:30

4 Answers4

1

The python.conda interpreter was added in 0.7.0.

Here are related PRs

So, i would like to suggest to use 0.7.0+ and refer Zeppelin Doc: Conda Interpreter.

1ambda
  • 1,145
  • 8
  • 19
  • 2
    When I use "%python.conda list" then "java.io.IOException: error=2, No such file or directory" error is occurred. – Bethlee Feb 24 '17 at 08:36
  • I am using 0.7.0 and I don't see any reference to Conda in the interpreter list. The instructions at http://zeppelin.apache.org/docs/latest/interpreter/python.html#conda will not work. What should the interpreter settings for conda look like? – Chuck Carlson Mar 02 '17 at 00:30
  • @ChuckCarlson Can u create new python interpreter? Then i think you will see `python.conda`. Because your python interpreter setting had been created before `python.conda` was implemented. – 1ambda Mar 02 '17 at 09:57
1

I did the following to use Anaconda in Zeppelin:

  1. Within the Zeppelin UI click 'Interpreter'
  2. Find the section for the 'Python' interpreter
  3. (In the Python interpreter section) Set 'zeppelin.python' to '/home/YOUR USERNAME/anaconda2/bin/python'

    print(sys.version) 2.7.13 |Anaconda 4.3.0 (64-bit)| (default, Dec 20 2016, 23:09:15)

tulle
  • 11
  • 1
1

I discovered that you cannot install conda via pip. You need, at a minimum, miniconda. Here's what I did on an Ubuntu 16.04 system:

  1. Download the miniconda installer from https://conda.io/miniconda.html
  2. Install miniconda
    I chose to install to /opt/miniconda3, you can choose differently
  3. Update your PATH before starting Zeppelin
    i.e. PATH=/opt/miniconda3/bin:$PATH

At this point it should work. You can try it out by creating a new notebook (or opening an existing notebook), typing %python.conda info in a paragraph, and running that paragraph.

One downside to this is that you end up using the Python interpreter bundled with miniconda rather than the Python interpreter installed with the system.

JZimmerman
  • 404
  • 3
  • 10
0

do:

  • in apace zeppelin ui click on interpreter.

  • find python interpreter

  • click on edit

  • change below property:

    zeppelin.python -------> path of python in anaconda

for example:

  • zeppelin.python : /home/abbas/anaconda/bin/python