My Anaconda/Jupyter Setup

This is mainly for myself so that I could rebuild my setup from scratch, but it would be nice if anyone else can benefit from it!

This is incomplete. I have class in 30 minutes. But this should have the majority of the information necessary for me to complete this post. Some of this information or these urls may even be repeated here… – it will automatically detect your operating system

note: when installing python packages in anaconda, always first try to install using conda, e.g. `conda install somepackage`. if that doesn’t work, try googling to find if it can be installed using conda under a different channel, e.g. “-c ericmjl” in “conda install -c ericmjl environment_kernels” (from below). Finally, if those fail, resort to “pip install somepackage”.

conda create python=3.6 -n env_name
# source the environment. after sourcing that environment, all installations will go in there.
source activate env_name
conda install -c conda-forge jupyter_contrib_nbextensions
# this is automatically installed as a dependency of jupyter_contrib_nbextensions, so there’s no need to install it if installing the other one
# conda install -c conda-forge jupyter_nbextensions_configurator

# ipdb (IPython debugger): from conda, on github
conda install -c conda-forge ipdb
conda install -c conda-forge ipython-sql

to see which environment the notebook is currently running in:
conda install -c ericmjl environment_kernels
which links to

pip install environment_kernels # can this not be done with “conda install” instead?

Good example of a Jupyter Notebook: (which analyzes survey results of people who participate on, where Kaggle is “The Home of Data Science & Machine Learning”).

Naming Conda Environments so they can be seen from inside Jupyter Notebooks:
ipykernel should be installed. the url explains how you can install it.
python -m ipykernel install –user –name myenv –display-name “Python 3.? (myenv)”
If you are already in a Jupyter Notebook in that environment, you can reload the page, and go to Jupyter Notebook Menubar -> Kernel -> Change Kernel -> and you should be able to see the kernel you just renamed. (even if you are already in that kernel/environment, the name won’t show up until you reload that kernel.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.