How to setup a jupyter notebook with an Anaconda VirtualEnv

Here I will show you how to setup an Anaconda VirtualEnv with jupyter notebook.

In first activate anaconda :
$ cd /localstorage/conda/bin
$ source activate
(root) $ conda info -e
# conda environments:
#
root                  *  /localstorage/conda
(root) $
Create new Anaconda virtual Env.
$ conda create -n jupyter-notebook jupyter notebook
[...]
[      COMPLETE      ]|####| 100%
#
# To activate this environment, use:
# > source activate jupyter-notebook
#
# To deactivate this environment, use:
# > source deactivate jupyter-notebook
#
(root) $
Launch jupyter-notebook

In first you will see this error because on sismologie computer IPV6 network is disable.

(root) $ source activate jupyter-notebook
(jupyter-notebook) $ jupyter notebook
[...]
OSError: [Errno 99] Cannot assign requested address

So you have to specifie on which interface you want to launch it :

If you just want it in local :

$ jupyter notebook --ip 127.0.0.1
[I 16:04:35.834 NotebookApp] Serving notebooks from local directory: /localstorage/conda/bin
[I 16:04:35.835 NotebookApp] 0 active kernels
[I 16:04:35.835 NotebookApp] The Jupyter Notebook is running at: http://127.0.0.1:8888/
[I 16:04:35.835 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

If you want to share it on the network (don’t forget to change the xxx to your last digit ip) :

$ ip a | grep 10.1.5 | awk '{print $2}'
10.1.5.xxx/24
$ jupyter notebook --ip 10.1.5.xxx
[I 16:11:10.331 NotebookApp] Serving notebooks from local directory: /localstorage/conda/bin
[I 16:11:10.331 NotebookApp] 0 active kernels
[I 16:11:10.331 NotebookApp] The Jupyter Notebook is running at: http://10.1.5.xxx:8888/
[I 16:11:10.331 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).