Setting up your development environment

The development of extensions requires a certain set of tools that have been set up to work together. While it is possible to install these tools systemwide, it is generally good practice to use a virtual environment manager such as Virtualenv or Anaconda. If Miniconda hasn't been installed, follow the instructions at https://docs.conda.io/en/latest/miniconda.html# before continuing.

Besides JupyterLab and Node.js, you will also need to install cookiecutter. This is a tool that creates a project based on a template. The Jupyter organization have produced four (+1) templates that work with cookiecutter and are available on GitHub (https://github.com/jupyterlab?q=cookiecutter). They are JavaScript and TypeScript templates for generic extensions and TypeScript templates for mime renderers and themes (the JavaScript mime renderer has been archived).

To create a new environment for developing JupyterLab extensions, run the following command:

conda create -n jupyterlab-ext -c conda-forge --override-channels nodejs jupyterlab cookiecutter
The preceding command tells conda (Anaconda) to create a new virtual environment called jupyterlab-ext (-n) that installs nodejs (and npm), jupyterlab, and cookiecutter from conda-forge (a more up-to-date but less stable repository for Anaconda).

Use the following command to activate the environment:

conda activate jupyterlab-ext

Each time the Anaconda prompt is closed, you will have to run this command to reactivate the development environment.

A cool way to develop is to launch jupyterlab in jupyterlab-ext and then use the built-in Terminal.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.97.64