-
Notifications
You must be signed in to change notification settings - Fork 7
Installation
Prerequisites: python 3 (>3.3), Jupyter 4 (with all dependencies), the svgling
package.
The current release version of the lambda notebook is 0.7.0
- It is available on PyPI via
pip install lambda-notebook
. - Download the source here: https://github.com/rawlins/lambda-notebook/archive/v0.7.0.zip.
The current trunk (unreleased) version can be downloaded at: https://github.com/rawlins/lambda-notebook/archive/master.zip, or via git clone https://github.com/rawlins/lambda-notebook.git
.
Installing the lambda notebook package gives you:
- the
lamb
python package - the lambda notebook kernel
This kernel is an extension of the regular python kernel that also imports the specialized magic
commands used by the lambda notebook; when you create a new notebook you will be able to choose this kernel. Using it is optional, and (if the lamb
package is installed) you can equivalently put import lamb.auto
at the top of a notebook. However, documentation and samples use the kernel.
To use this package in Google Colaboratory (colab), see here.
The best way to install Jupyter is via Anaconda and related systems. All things equal, I recommend Miniforge, but regular Anaconda or Miniconda also work.
- Install one of the above package management systems.
- (Optional) create and activate an environment to work with the lambda notebook in. (Details beyond this guide, but it's not too bad, and I highly recommend it.)
- To make sure everything available via conda that you need is present in the environment you are using, run at the command line
conda install jupyter jupyterlab svgwrite
. (A base anaconda environment may already have most or all of this installed.) - Finally, run at the command line
pip install lambda-notebook
, which should install justlambda-notebook
and its dependencysvgling
(both of these are only available via pip).
Command line: several steps above refer to the command line. On the mac, this is Terminal (which should be enabled for conda automatically), on linux this is your favorite terminal emulator. On Windows, if you've installed anaconda, you should be able to use the "Anaconda Prompt" App.
Alternatively, if you just start jupyter lab or notebook via Anaconda Navigator, everything above that can be run on the command line can also be run in a jupyter notebook by prefixing with a !
. E.g. !pip install lambda-notebook
.
Alternatively, you could install everything from pip:
- First, install current Python 3 via http://www.python.org/.
- Run
pip install lambda-notebook
. This will force all dependencies to be installed.
To use the repository version, download the repository (e.g. via git clone https://github.com/rawlins/lambda-notebook.git
) and install the prerequisites into your current environment as above (you'll need jupyter
, jupyterlab
, svgling
). Then use the install-lambda-kernel.py
script in the main repository directory. The installed kernel will use the repository version of the lamb
module from wherever you have that directory. If you'd like this to co-exist with an installed version of the current lambda notebook release, you can use --dev
as an argument to this script (you may need to change the kernel in packaged notebooks). It is highly recommended, as above, that you do this all in some form of environment.
Now, start e.g. jupyter lab
and use the lambda-notebook
(or lambda-notebook-dev
if you used --dev
) kernel as discussed below.
The above installation methods install a kernel
that will let you run a lambda notebook document. To start Jupyter, run jupyter lab
(or jupyter notebook
) and then open or create a notebook using this kernel.
The repository contains many example and documentation notebooks which make a good starting point. You can either get these via one of the source downloads, or by running the following in a python interpreter (changing the target directory as appropriate):
import lamb.lnsetup
lamb.lnsetup.install_notebooks("~/Documents/")
This will create a subdirectory lambda-notebook
at the provided directory name, and install the documentation and examples.