Setting up a development install#
JupyterHub is written in the Python programming language and requires you have at least version 3.6 installed locally. If you haven’t installed Python before, the recommended way to install it is to use Miniforge.
If you have not installed NodeJS before, we recommend installing it in the
miniconda environment you set up for Python.
You can do so with
conda install nodejs.
Many in the Jupyter community use [
managing node dependencies.
Setting up a development install#
When developing JupyterHub, you would need to make changes and be able to instantly view the results of the changes. To achieve that, a developer install is required.
This guide does not attempt to dictate how development
environments should be isolated since that is a personal preference and can
be achieved in many ways, for example,
docker, etc. See this
forum thread for
a more detailed discussion.
Clone the JupyterHub git repository to your computer.
git clone https://github.com/jupyterhub/jupyterhub cd jupyterhub
Make sure the
pythonyou installed and the
npmyou installed are available to you on the command line.
This should return a version number greater than or equal to 3.6.
This should return a version number greater than or equal to 5.0.
configurable-http-proxy(required to run and test the default JupyterHub configuration) and
yarn(required to build some components):
npm install -g configurable-http-proxy yarn
If you get an error that says
Error: EACCES: permission denied, you might need to prefix the command with
sudomay be required to perform a system-wide install. If you do not have access to sudo, you may instead run the following commands:
npm install configurable-http-proxy yarn export PATH=$PATH:$(pwd)/node_modules/.bin
The second line needs to be run every time you open a new terminal.
If you are using conda you can instead run:
conda install configurable-http-proxy yarn
Install an editable version of JupyterHub and its requirements for development and testing. This lets you edit JupyterHub code in a text editor & restart the JupyterHub process to see your code changes immediately.
python3 -m pip install --editable ".[test]"
Set up a database.
The default database engine is
sqliteso if you are just trying to get up and running quickly for local development that should be available via Python. See The Hub’s Database for details on other supported databases.
You are now ready to start JupyterHub!
You can access JupyterHub from your browser at
Using DummyAuthenticator & SimpleLocalProcessSpawner#
To simplify testing of JupyterHub, it is helpful to use
DummyAuthenticator instead of the default JupyterHub
authenticator and SimpleLocalProcessSpawner instead of the default spawner.
There is a sample configuration file that does this in
testing/jupyterhub_config.py. To launch JupyterHub with this
jupyterhub -f testing/jupyterhub_config.py
DummyAuthenticator allows you to log in with any username & password, while SimpleLocalProcessSpawner allows you to start servers without having to create a Unix user for each JupyterHub user. Together, these make it much easier to test JupyterHub.
Tip: If you are working on parts of JupyterHub that are common to all authenticators & spawners, we recommend using both DummyAuthenticator & SimpleLocalProcessSpawner. If you are working on just authenticator-related parts, use only SimpleLocalProcessSpawner. Similarly, if you are working on just spawner-related parts, use only DummyAuthenticator.
This section lists common ways setting up your development environment may fail, and how to fix them. Please add to the list if you encounter yet another way it can fail!
lessc not found#
python3 -m pip install --editable . command fails and complains about
lessc being unavailable, you may need to explicitly install some
python3 setup.py js # fetch updated client-side js python3 setup.py css # recompile CSS from LESS sources python3 setup.py jsx # build React admin app