jupyterlab-git
jupyterlab-git copied to clipboard
conda install
Hi, I am using jupyterlab in an offline environment. I have found that conda pack makes getting jupyterlab up and running in the offline environment pretty easy, however jupyterlab-git is the one extension that I use which is not packaged using conda.
I understand that it might be a lot of work, but it would be greatly appreciated if it was possible to install jupyterlab-git via conda.
Thanks for the work on this very useful extension.
I will note that I couldn't get this to work with my setup, I was able to install the package from conda: https://anaconda.org/conda-forge/jupyterlab-git
Didn't know about conda pack, pretty cool!
@b-trav I did not know conda pack. Thx for sharing.
Can you provide more information on what you did:
- did you install Jupyterlab-git server and frontend extensions and rebuild Jupyterlab in the reference environment?
- the final Jupyterlab files with extensions is stored in conda folder
share/jupyter/lab/static
. Is that folder packed with the environment?
As intermediate step, you could use jupyterlab_delux cookiecutter to create a package with Jupyterlab packed with preinstalled extensions.
Here is how I get JupyterLab with Git up and running on an offline computer.
- Install Anaconda on both online and offline computer
- Install conda-pack in base environment on online computer
conda install -c conda-forge conda-pack
- Install jupyterlab on online computer
conda create -n jupyterlab jupyterlab
- Install extension on online computer
conda activate jupyterlab
pip install jupyterlab-git
jupyter labextension install @jupyterlab/git
- Pack the environment and the extension on the online computer (you will need to re-run conda install after running pip for pack to work, and you will need to get your version of jupyterlab - here I am using 1.2.4)
cd $CONDA_PREFIX/share/jupyter
tar -czf lab.tar.gz lab
conda list | grep jupyterlab
conda install jupyterlab=1.2.4 --force-reinstall
conda pack -n jupyterlab
- Unpack on the offline computer
cd /home/$USER/anaconda3/envs
tar -xzf jupyterlab.tar.gz
source jupyterlab/bin/activate
conda unpack
rm -rf $CONDA_PREFIX/share/jupyter/lab
tar -xzf lab -C $CONDA_PREFIX/share/jupyter
@b-trav Thanks for reporting back a working solution.
One comment: I'm surprised you had to mix conda
and pip
. Did you try to use the conda package?
The following variant for steps 3 and 4 should work:
- Install jupyterlab on online computer
conda create -c conda-forge -n jupyterlab jupyterlab jupyterlab-git
- Build JupyterLab with extensions on online computer
conda activate jupyterlab
jupyter lab build
Yes @fcollonval , that seems a much easier simplification. I seem to remember that I couldn't conda install jupyterlab-git, though I now can't remember why. It could have been that the conda-forge mirror I was using was not completely populated.