The Jupyter notebook is not yet available in the Debian 8.3 and Ubuntu 16.04 LTS repositories. Instead, the IPython notebook can be installed:
sudo apt-get install nodejs-legacy npm ipython ipython-notebook
Alternatively, the Jupyter notebook can be installed via
pip installs the latest Jupyter release from the Python Package Index:
sudo apt-get install nodejs-legacy npm g++ libzmq3-dev python-dev python-pip sudo pip install --upgrade jupyter
And Anaconda provides a data science platform that distributes both
Jupyter (by default) and
npm prefix to your home folder:
Node.js needs upgrading to a recent version. You can do so by running:
sudo apt-get install curl curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs
The instructions for upgrading
Node.js have been adapted from those found here.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install pkg-config node zeromq sudo easy_install pip pip install --upgrade pyzmq jupyter
Once the dependencies have been installed,
Also note that the build tool
node-gyp (which is part of Node.js and is used to compile native modules) requires Python 2.
Jupyter could be installed following the instructions here. I find more convenient to install a Python distribution such as Anaconda.
Anaconda not only installs
Jupyter and its requirements, but also a selection of frequently-used Python packages.
Node.js provides a Windows installer. However, the build tool
node-gyp will not be functional unless one of the recognised C++ compilers is installed. See here for more details, here for Visual Studio Express 2012 or here for a link to Visual Studio Express 2013.
nvm is a popular Node Version Manager for users to install specific versions of Node in their own home folder. These types of installations do not require the use of
sudo to install global packages, simply run:
Another consideration for
Note that in what follows, phrases enclosed in
> denote places where you should substitute a value appropriate to your specific setup. If you haven't already created your conda virtual environment, do so now:
conda create --name <name of new virtual environment> conda activate <name of new virtual environment> conda install nodejs jupyter
conda version 4.5.4. and version 1.0.0 of the
jupyter conda package, the location of Jupyter in the new virtual environment will be
$CONDA_PREFIX/etc/jupyter. This motivates the following commands:
cd $CONDA_PREFIX/etc mkdir -p ./jupyter/nbdata ./conda/activate.d ./conda/deactivate.d touch ./conda/activate.d/env_vars.sh ./conda/deactivate.d/env_vars.sh
Now use a text editor to make the contents of
$CONDA_PREFIX/etc/conda/activate.d/env_vars.sh be the following:
#!/bin/bash export JUPYTER_DATA_DIR=$CONDA_PREFIX/etc/jupyter/nbdata export JUPYTER_CONFIG_DIR=$CONDA_PREFIX/etc/jupyter/nbconfig
and then use a text editor to make the contents of
$CONDA_PREFIX/etc/conda/deactivate.d/env_vars.sh be the following:
#!/bin/bash unset JUPYTER_DATA_DIR unset JUPYTER_CONFIG_DIR
Exit and then re-enter the new virtual environment:
conda deactivate conda activate <name of new virtual environment>
#!/bin/bashonly if one's shell is BASH, but
#!/bin/shif one's shell is Bourne shell, or
#!/bin/zshif one's shell is ZSH, etc.
JUPYTER_CONFIG_DIR) isn't strictly necessary. However it will allow you to make changes to Jupyter's settings within that virtual environment without those changes propagating outside of the environment.