How to set up development of Jupyterlab-latex extension?

I’ve spent some time trying to get a development environment set up for the jupyterlab-latex extension so that I could try adding some features that would be useful for me. However, I’m having trouble getting it working in the first place. It seems like this may be due to the doubled nature of the extension, with the server extension and the lab extension needed to get the whole thing to work.

I tried cloning the repo and then running pip install -ve .. This seemed to work correctly but the labextension didn’t show up under jupyter labextension list. So I followed it up by running jlpm run build and jupyter labextension install .. This seemed to work as well, and the local extension was listed under jupyter labextension list, but when I tried to use the extension I get the following error, which I haven’t been able to resolve. “server extension error: You probably do not have jupyterlab_latex installed or enabled. Please, run “pip install -U jupyterlab_latex.” If that does not work, try “jupyter serverextension enable --sys-prefix jupyterlab_latex”.”

My question is, what’s the appropriate way to set up the development on an extension like this? Maybe if I’m not being dumb and it’s potentially not obvious, it’d be useful to add a “development” section to the extension readme?

What version of JupyterLab are you using? For JupyterLab 3.0 the command to enable server extensions (mostly) changed to jupyter server extension enable (not the extra space between server and extension); the messages might be outdated as I don’t think anyone upgraded jupyterlab-latex to JupyterLab 3.0.

As for pip-install you might want to use pip install -e . (from cloned repository) if you plan to modify the server extension too.

As @krassowski says, the extension doesn’t yet support JupyterLab 3.x:

Yes, I was trying to use the version with Jupyterlab 2.0 and having these troubles, but given the impending update I think I’ll wait until the update comes through anyways. Thanks for the response and ideas, I’ll update when I get back to debugging this.

For the record, I ran into similar issues with jupyterlab 3, and the solution was indeed using jupyter server extension enable --sys-prefix jupyterlab_latex instead of jupyter serverextension enable --sys-prefix jupyterlab_latex.

1 Like

This helped me on jupyter lab 3. Thank You!