The following directions explain how to setup your Jupyter development environment. The goal is to isolate each one of your projects in their own "virtual environment" (a.k.a. conda environment), so you can easily switch between projects without contaminating your installations, dependencies, etc.
Table of Contents
- Create a folder for your extension or project inside
projects/
mkdir my_extension
- Create a conda environment for that project (and install pip).
conda create -n my_extension pip
- Switch into that environment. You'll need to be in this environment to install the development versions of the packages you're work on (see steps 6-8).
conda activate my_extension
- (Optional) Install dependencies you make need, that don't need a development version.
pip install numpy
- Navigate to that extension's folder.
cd my_extension
- Clone any projects you will need for development.
git clone https://www.github.com/jupyterlab/jupyterlab
git clone https://www.github.com/my_username/my_extension
- Create and switch into development branches in each repo. Example:
# Change into jupyterlab repo.
cd jupyterlab
# Create branch and switch to it.
git checkout -b my_feature
# Change into my_extension repo.
cd ../my_extension
# Create branch and switch to it.
git checkout -b my_feature
- Install those packages (in that conda environment) using the development installation instructions.
- Open your favorite editor (I use VSCode) inside your project folder.
You'll see all the libraries you'll use for development in your current workspace. When you test your project, it will only use the libraries+branches you installed in that environment.
- Navigate to your project
cd /path/to/projects/my_extension.
- Switch to the conda environment for that project
conda activate my_extension
- Open your favorite editor (I use VSCode) inside your project folder.
List your conda environments:
conda env list
Leave an environment
conda deactivate