Setup jupyter notebook with anaconda

Setup jupyter notebook with anaconda

Vikash Kumar

1 minute read

  1. Create virtual environment. I prefer this approach, as it keeps the system environment sane.

    conda create -n myenv python=3.7  # creates the virtual environment "myenv" 
                                      # with python3.7
    conda activate myenv              # activate the virtual environment "myenv"
    
  2. Install ipykernel package in the vritual envieonment myenv created above. It is the kernel which executes the code written in Jupyter notebook. For python, ipykernel is one of the kernel which executes the python code.

    conda install -n myenv ipykernel
    python -m ipykernel install --user --name myenv --display-name first_env
    
    # You can use any name of your choice with --display-name
    
  3. Install conda kernel.

    conda install -c myenv nb_conda_kernels
    

_nb_condakernels is an extension which enables a Jupyter notebook or application in the conda environment to access any other kernels available in the environment. You can read more about _nb_condakernels here.

  1. Go to your folder and start jupyter notebook.

    jupyter notebook
    

That’s it. You are ready to code.

comments powered by Disqus