Extension installing but not working through pip install on JupyterLab 3.5.0
johnnybarrels opened this issue · 11 comments
Describe the bug
After installing this package through pip, then starting Jupyter Lab (3.5.0), the package is not working. When clicking on the Code Snippet Explorer icon in left sidebar, the sidebar window is completely blank (see screenshots below). Also, when right-clicking a cell and selecting Save As Code Snippet, nothing happens.
Upon opening the developer console, I notice a jupyterlab-code-snippets:snippets validation error of "should have required property 'id'" (see screenshot below).
To Reproduce
- Install JupyterLab >= 3.5.0
pip install jupyterlab-code-snippets- Click on
Code Snippet Explorericon in left sidebar - (Observe that the sidebar window is completely blank)
Expected behavior
Normal use of extension: snippets sidebar window not blank, able to save code in cells as new snippet.
Screenshots
Blank Code Snippet Explorer window
Developer console
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Edge
jupyter_client 7.4.4
jupyter_core 4.11.2
jupyter-server 1.23.0
jupyterlab 3.5.0
jupyterlab-code-snippets 2.1.0
jupyterlab-pygments 0.2.2
jupyterlab_server 2.16.2
jupyterlab-widgets 1.1.1
ipykernel 6.17.0
ipython 8.6.0
ipython-genutils 0.2.0
ipywidgets 7.7.2
Issue resolved by using solution listed here: #228 (comment)
I would submit a PR to resolve this issue but not sure which copy of the plotting_sine snippet to add "id": 0, as it is already present in:
and:
Hi @johnnybarrels,
I have started looking into this issue. I think the id needs to start from 1. With the recent jupyterlab, id of 0 means undefined. But, we have some bigger build issues. Will create a PR if it's done!
Should work now with a new version!
I has the same issue. but resolve with another simple method, @jahn96 do you has any idea?
work well with :
Current version is 2.2.0 but conda-forge hasn't been updated yet. Is it on their side?
I install the extention 4 days ago actually , by the follow command .
I can not get the version number , because pip freeze do not show this extention name.
jupyter labextension install jupyterlab-code-snippets
jupyter lab clean
jupyter lab build
@shuivin this command will print something:
jupyter labextension list
As you didn't installed with pip, it didn't added pip package.
Thanks!
the code-snippets has the right version, and pip has installed.
pip 21.1.1
jupyterlab-code-snippets v2.2.0 enabled ok
PS D:\temp> jupyter labextension list
JupyterLab v3.5.2
C:\Users\zh0ngx1ngzhe-su\AppData\Roaming\Python\share\jupyter\labextensions
@jupyterlab/fasta-extension v3.2.0 enabled ok (python, jupyterlab-fasta)
@jupyterlab/geojson-extension v3.3.1 enabled ok (python, jupyterlab-geojson)
@jupyterlab/katex-extension v3.3.0 enabled ok (python, jupyterlab-katex)
@jupyterlab/mathjax3-extension v4.3.0 enabled ok (python, jupyterlab-mathjax3)
@jupyterlab/vega2-extension v3.2.0 enabled ok (python, jupyterlab-vega2)
@jupyterlab/vega3-extension v3.2.0 enabled ok (python, jupyterlab-vega3)
c:\python\share\jupyter\labextensions
jupyter-matplotlib v0.11.2 enabled ok
jupyterlab_pygments v0.2.2 enabled ok (python, jupyterlab_pygments)
@jupyter-widgets/jupyterlab-manager v5.0.5 enabled ok (python, jupyterlab_widgets)
Other labextensions (built into JupyterLab)
app dir: C:\Python\share\jupyter\lab
jupyterlab-code-snippets v2.2.0 enabled ok
Disabled extensions:
@jupyterlab/mathjax2-extension:plugin
PS D:\temp>
PS D:\temp> pip --version
pip 21.1.1 from c:\python\lib\site-packages\pip (python 3.8)
@shuivin you have pip installed, but you didn't install plugin with pip. That's why pip doesn't show it. That's pretty expected result for your case.
it didn't added pip package.
Yeah, I should have said pypi package, not "pip" package.
@jahn96: Is this really fixed in the 2.2.0/2.2.1 version? After installing the current version from pypi (pip says that this is 2.2.1, jupyter says it is 2.2.0) the issue remains and the workaround of adding an empty snippets is still required.
I found a related error that caused the extra junk to persist.



