jupyterhub / nbgitpuller

Jupyter server extension to sync a git repository one-way to a local path
https://nbgitpuller.readthedocs.io
BSD 3-Clause "New" or "Revised" License
205 stars 84 forks source link

nbgitpuller not showing as an extension #340

Closed banson-aiq closed 4 months ago

banson-aiq commented 4 months ago

Bug description

When using pip to install the nbgitpuller extension, the pip install completes successfully but nbgitpuller does not show up in the list of extensions. I have used these steps to successfully install theme-darcula, so I can't see why nbgitpuller is not working

Install...

sudo /opt/jupyterhub/bin/python3 -m pip install nbgitpuller

Check the extensions...

/opt/jupyterhub/bin/jupyter labextension list

`sys_prefix` level settings are read-only, using `user` level for migration to `lockedExtensions`
JupyterLab v4.1.0
/home/ubuntu/.local/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)

/opt/jupyterhub/share/jupyter/labextensions
        @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)
        @telamonian/theme-darcula v4.0.0 enabled OK (python, theme-darcula)

How to reproduce

  1. Follow these instructions to setup JupyterHub on Ubuntu22.04 https://github.com/jupyterhub/jupyterhub-the-hard-way/blob/35ddfb49ad81771551c6549696ccec960564d5e4/docs/installation-guide-hard.md

  2. Set up the default conda environment for all Users, but do not setup user's own conda environments

  3. As user ubuntu on the server run these commands to install & check the extension

    
    $ sudo /opt/jupyterhub/bin/python3 -m pip install nbgitpuller

$ /opt/jupyterhub/bin/jupyter labextension list sys_prefix level settings are read-only, using user level for migration to lockedExtensions JupyterLab v4.1.0 /home/ubuntu/.local/share/jupyter/labextensions jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)

/opt/jupyterhub/share/jupyter/labextensions @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets) @telamonian/theme-darcula v4.0.0 enabled OK (python, theme-darcula)


#### Expected behaviour

I was expecting the extension to show up in the list of extensions and be usable.

#### Actual behaviour

Extension is not showing in the list, and is not usable.

### Your personal set up
 - OS: ubuntu 20.04
 - Version(s):
$ /opt/jupyterhub/bin/jupyterhub --version
4.0.2

$ /opt/jupyterhub/bin/python --version
Python 3.10.12

<details><summary>Full environment</summary>
<!-- For reproduction, it's useful to have the full environment. For example, the output of `pip freeze` or `conda list` --->

$ /opt/jupyterhub/bin/pip freeze alembic==1.13.1 anyio==4.2.0 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-generator==1.10 async-lru==2.0.4 attrs==23.2.0 Babel==2.14.0 beautifulsoup4==4.12.3 bleach==6.1.0 certifi==2024.2.2 certipy==0.1.3 cffi==1.16.0 charset-normalizer==3.3.2 comm==0.2.1 cryptography==42.0.2 debugpy==1.8.0 decorator==5.1.1 defusedxml==0.7.1 exceptiongroup==1.2.0 executing==2.0.1 fastjsonschema==2.19.1 fqdn==1.5.1 greenlet==3.0.3 h11==0.14.0 httpcore==1.0.2 httpx==0.26.0 idna==3.6 ipykernel==6.29.1 ipython==8.21.0 ipywidgets==8.1.1 isoduration==20.11.0 jedi==0.19.1 Jinja2==3.1.3 json5==0.9.14 jsonpointer==2.4 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 jupyter-events==0.9.0 jupyter-lsp==2.2.2 jupyter-telemetry==0.1.0 jupyter_client==8.6.0 jupyter_core==5.7.1 jupyter_server==2.12.5 jupyter_server_terminals==0.5.2 jupyterhub==4.0.2 jupyterlab==4.1.0 jupyterlab-widgets==3.0.9 jupyterlab_pygments==0.3.0 jupyterlab_server==2.25.2 Mako==1.3.2 MarkupSafe==2.1.5 matplotlib-inline==0.1.6 mistune==3.0.2 nbclient==0.9.0 nbconvert==7.15.0 nbformat==5.9.2 nbgitpuller==1.2.0 nest-asyncio==1.6.0 notebook_shim==0.2.3 oauthlib==3.2.2 overrides==7.7.0 packaging==23.2 pamela==1.1.0 pandocfilters==1.5.1 parso==0.8.3 pexpect==4.9.0 platformdirs==4.2.0 prometheus-client==0.19.0 prompt-toolkit==3.0.43 psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pycparser==2.21 Pygments==2.17.2 pyOpenSSL==24.0.0 python-dateutil==2.8.2 python-json-logger==2.0.7 PyYAML==6.0.1 pyzmq==25.1.2 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rpds-py==0.17.1 ruamel.yaml==0.18.5 ruamel.yaml.clib==0.2.8 Send2Trash==1.8.2 six==1.16.0 sniffio==1.3.0 soupsieve==2.5 SQLAlchemy==2.0.25 stack-data==0.6.3 terminado==0.18.0 theme-darcula==4.0.0 tinycss2==1.2.1 tomli==2.0.1 tornado==6.4 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 typing_extensions==4.9.0 uri-template==1.3.0 urllib3==2.2.0 wcwidth==0.2.13 webcolors==1.13 webencodings==0.5.1 websocket-client==1.7.0 widgetsnbextension==4.0.9

</details>

<details><summary>Configuration</summary>
<!--
For JupyterHub, especially include information such as what Spawner and Authenticator are being used.
Be careful not to share any sensitive information.
You can paste jupyterhub_config.py below.
To exclude lots of comments and empty lines from auto-generated jupyterhub_config.py, you can do:
    grep -v '\(^#\|^[[:space:]]*$\)' jupyterhub_config.py
-->

```python
c = get_config()  #noqa
c.Spawner.default_url = '/lab'

Logs ``` # paste relevant logs here, if any ```
welcome[bot] commented 4 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

consideRatio commented 4 months ago

I think maybe you installed nbgitpuller in the jupyterhub environment, and checked for it as a jupyterlab extension rather than a jupyter-server extension.

nbgitpuller is a jupyter-server extension that should reside in the user environment, so install it in the user's Python environment and check for it with jupyter server extension list.

banson-aiq commented 4 months ago

Yes that was it, after installing in the shared user's conda environment and using the server extension command I can see it. Thank you!

sudo /opt/conda/envs/python/bin/python -m pip install nbgitpuller

/opt/conda/envs/python/bin/python -m jupyter server extension list
Config dir: /home/ubuntu/.jupyter

Config dir: /opt/conda/envs/python/etc/jupyter
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.2.2 OK
    jupyter_server_terminals enabled
    - Validating jupyter_server_terminals...
      jupyter_server_terminals 0.5.2 OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 4.1.0 OK
    nbgitpuller enabled
    - Validating nbgitpuller...
      nbgitpuller 1.2.0 OK
    notebook_shim enabled
    - Validating notebook_shim...
A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
      notebook_shim  OK

Config dir: /usr/local/etc/jupyter