1

I have installed the latest version of Anaconda on my Ubuntu Linux virtual machine.

I successfully launched Jupyter in my browser using the following command : ipython notebook .

But when I want to create a new notebook, I have to choose between Python [conda root] and Python [default].

enter image description here

So, what are the differences between them? Which one to choose to create a new Notebook?

(I want to use Jupyter to work with Apache Spark)

Thank you.

// Update 22/10/2016

I created a new Environment python2 using : conda create -n python2 python=2.7 anaconda and I activate this new one : source activate python2.

When I list all environments : $ conda info --envs, I see these two lines :

python2               *  /home/opentuto/anaconda2/envs/python2
root                     /home/opentuto/anaconda2

Now, my notebook, look like this :

enter image description here

Any solution!!?

MDIT
  • 1,508
  • 5
  • 25
  • 38

2 Answers2

1

Python [conda root] and Python [default].

What you are seeing are notebook kernels that you can use to create notebooks. The kernels listed are dependent on anaconda environments that you create and kernels installed. You see only default and conda root, because I'm assuming that you have simply installed the newest version of Anaconda for python 2.7 or 3.5. When installing Anaconda, it creates a root virtual environment and you can change the default environment based on environments that you have set up.

See the following for more information related to your question:

How do I add python3 kernel to jupyter (IPython)

https://github.com/jupyter/notebook/issues/1716

Jupyter and Apache Spark

I recommend setting up jupyter and spark in the following manner w/ your .profile.

export SPARK_PATH=~/...
export PYSPARK_DRIVER_PYTHON="jupyter"
export PYSPARK_DRIVER_PYTHON_OPTS="notebook"

After sourcing these variables you can call $ ./bin/pyspark and you'll have a spark context in a jupyter notebook.

Community
  • 1
  • 1
cameres
  • 498
  • 2
  • 5
  • 15
  • Yes I'm using Anaconda for python 2.7. If I understand, actually I have 2 Python environments (Python pré-installed in my Ubuntu and Python installed by Anaconda). So, I have to switch to Anaconda Python? Thanks. – MDIT Oct 22 '16 at 12:17
  • When I refer to environments, I'm referring to Anaconda environments. In your update you created another environment which installs another ipython kernel (see output of the "The following NEW packages will be INSTALLED:") That is the additional option you can now select. – cameres Oct 22 '16 at 16:50
0

The first approach is removing the extension... not recommanded.

The second approach is to just disable the extensions...recommanded

you can do something like this:

python -m nb_conda_kernels.install --disable --prefix=<ENV_PREFIX>

jupyter-nbextension disable nb_conda --py --sys-prefix

jupyter-serverextension disable nb_conda --py --sys-prefix

In this case, you just disable nb_conda_kernels and nb_conda that depend on the first one, but still keep the other ones active.

NOTE: Replace ENV_PREFIX with your root environment or another conda environment where the extensions have been installed.

HISI
  • 4,557
  • 4
  • 35
  • 51