Public
Snippet $223 authored by Jérome Perrin

Install jupyterlab in virtualenv

Edited
jupterlab_install.sh
#!/bin/sh

export PATH=$PATH:~/bin:~/.local/bin/:~/.local/nodejs/node-v4.4.4-linux-x64/bin/:

[ -f ~/.local/bin/pip ] || {
  echo "installing pip"
  curl https://bootstrap.pypa.io/get-pip.py | python - --user
}

[ -f ~/.local/bin/virtualenv ] || {
  echo "installing virtualenv"
  pip install --user virtualenv
}

[ -f ~/.local/nodejs/node-v4.4.4-linux-x64/bin/node ] || {
  echo "installing nodejs"
  mkdir -p ~/.local/nodejs/
  pushd ~/.local/nodejs/
  curl https://nodejs.org/dist/v4.4.4/node-v4.4.4-linux-x64.tar.xz | tar xfJ -
  popd
}

[ -f ~/src/jupyterlab/env/bin/jupyter ] || {
  echo "installing jupyterlab"
  mkdir -p ~/src/
  pushd ~/src/
  git clone https://github.com/jupyterlab/jupyterlab.git/ # was at 4e0449111eefc7379e2c2e9351e12c7f1975cc99 last time I could install succesfuly
  pushd ~/src/jupyterlab/
  virtualenv env
  . env/bin/activate
  pip install --editable .
  jupyter serverextension enable --py jupyterlab

  npm install supports-color
  npm install .
  npm run build
  deactivate
  popd
  popd
}

# start with:
. ~/src/jupyterlab/env/bin/activate
jupyter lab --ip 2001:... --