Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_load_jupyter_server_extension function was not found #112

Closed
jbwhit opened this issue May 7, 2024 · 8 comments
Closed

_load_jupyter_server_extension function was not found #112

jbwhit opened this issue May 7, 2024 · 8 comments
Assignees

Comments

@jbwhit
Copy link

jbwhit commented May 7, 2024

I'm not sure what functionality is missing, but I've installed/reinstalled jupysql and jupysql_plugin and still get the following error messages from the output of my terminal running jupyter lab.

jupysql_plugin | extension failed loading with message: ExtensionLoadingError('_load_jupyter_server_extension function was not found.')
    Traceback (most recent call last):
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 360, in load_extension
        extension.load_all_points(self.serverapp)
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 232, in load_all_points
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 232, in <listcomp>
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 223, in load_point
        return point.load(serverapp)
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 150, in load
        loader = self._get_loader()
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 119, in _get_loader
        loader = get_loader(loc)
      File "/Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages/jupyter_server/extension/utils.py", line 40, in get_loader
        raise ExtensionLoadingError(msg) from None
    jupyter_server.extension.utils.ExtensionLoadingError: _load_jupyter_server_extension function was not found.

Here's what I see when I run update:

❯ pip install --upgrade jupysql_plugin
Requirement already satisfied: jupysql_plugin in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (0.4.3)
Requirement already satisfied: ploomber-core in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from jupysql_plugin) (0.2.25)
Requirement already satisfied: pyyaml in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from ploomber-core->jupysql_plugin) (6.0.1)
Requirement already satisfied: posthog in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from ploomber-core->jupysql_plugin) (3.5.0)
Requirement already satisfied: requests<3.0,>=2.7 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from posthog->ploomber-core->jupysql_plugin) (2.31.0)
Requirement already satisfied: six>=1.5 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from posthog->ploomber-core->jupysql_plugin) (1.16.0)
Requirement already satisfied: monotonic>=1.5 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from posthog->ploomber-core->jupysql_plugin) (1.5)
Requirement already satisfied: backoff>=1.10.0 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from posthog->ploomber-core->jupysql_plugin) (2.2.1)
Requirement already satisfied: python-dateutil>2.1 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from posthog->ploomber-core->jupysql_plugin) (2.9.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from requests<3.0,>=2.7->posthog->ploomber-core->jupysql_plugin) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from requests<3.0,>=2.7->posthog->ploomber-core->jupysql_plugin) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from requests<3.0,>=2.7->posthog->ploomber-core->jupysql_plugin) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in /Users/jonathan/mambaforge/envs/mastery/lib/python3.10/site-packages (from requests<3.0,>=2.7->posthog->ploomber-core->jupysql_plugin) (2024.2.2)

Let me know if I can provide more information to help.

Mac OS Sonoma 14.4.1

@edublancas
Copy link
Contributor

@neelasha23 can you take a look? I remember a similar issue on jupysql's repository but can't remember what the conclusion was

@neelasha23
Copy link
Contributor

neelasha23 commented May 8, 2024

The jupyter server config files already exist in jupysql-plugin. So might be some path or package version issues. Here's the steps I tried on Mac Sonoma 14.1:

  1. Create a virtual environment
  2. pip install jupysql jupyterlab.
  3. Ensure jupyterlab is started from the virtual environment :
import sys
print(sys.executable)

If that's not the case please modify the PATH variable so it starts properly.

Here is the dependency lock file for your reference:

requirements.lock.txt

I think this issue is related. You can try downgrading the JupyterLab version also.

Please let me know if this doesn't help. More info on your package versions would be helpful

@jbwhit

@edublancas
Copy link
Contributor

edublancas commented May 9, 2024

I suspect this is because you're running jupysql-plugin 0.4.x in Jupyterlab 3.x

I checked the source code for jupysql-plugin 0.3.1 and there is a _load_jupyter_server_extension function

either upgrade jupyterlab or downgrade jupysql-plugin (example: pip install "jupysql-plugin<0.4.0")

closing, but feel free to re-open if this doesn't fix the issue

@jbwhit
Copy link
Author

jbwhit commented May 9, 2024

No, I'm not doing anything like that. I just created a new environment.

Here's what I just did:

mamba create --channel conda-forge --name jupybug python=3.10 jupyterlab jupyter notebook jupysql
mamba activate jupybug

❯ jupyter --version
Selected Jupyter core packages...
IPython          : 8.22.2
ipykernel        : 6.29.3
ipywidgets       : 8.1.2
jupyter_client   : 7.4.9
jupyter_core     : 5.7.2
jupyter_server   : 2.14.0
jupyterlab       : 4.2.0
nbclient         : 0.10.0
nbconvert        : 7.16.4
nbformat         : 5.10.4
notebook         : 6.5.6
qtconsole        : 5.5.2
traitlets        : 5.14.3


jupyter lab

Going into the extensions tab in the browser, I see the following:

Screenshot 2024-05-08 at 9 03 14 PM

I uninstall jupysql_plugin, reinstall, close down jupyter lab. Restart it and see the following:

❯ jupyter lab
[I 2024-05-08 21:07:03.108 ServerApp] jupysql_plugin | extension was successfully linked.
[I 2024-05-08 21:07:03.109 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-05-08 21:07:03.112 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-05-08 21:07:03.117 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-05-08 21:07:03.120 ServerApp] nbclassic | extension was successfully linked.
[I 2024-05-08 21:07:03.295 ServerApp] notebook_shim | extension was successfully linked.
/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/traitlets/traitlets.py:1241: UserWarning: Overriding existing pre_save_hook (nbdev_clean_jupyter) with a new one (nbdev_clean_jupyter).
  return self.func(*args, **kwargs)
[I 2024-05-08 21:07:03.358 ServerApp] notebook_shim | extension was successfully loaded.
[W 2024-05-08 21:07:03.358 ServerApp] jupysql_plugin | extension failed loading with message: ExtensionLoadingError('_load_jupyter_server_extension function was not found.')
    Traceback (most recent call last):
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 360, in load_extension
        extension.load_all_points(self.serverapp)
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 232, in load_all_points
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 232, in <listcomp>
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 223, in load_point
        return point.load(serverapp)
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 150, in load
        loader = self._get_loader()
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 119, in _get_loader
        loader = get_loader(loc)
      File "/Users/jonathan/mambaforge/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/utils.py", line 40, in get_loader
        raise ExtensionLoadingError(msg) from None
    jupyter_server.extension.utils.ExtensionLoadingError: _load_jupyter_server_extension function was not found.

Perhaps it's a mamba thing? A conda-forge thing?

If I have time later I'll do the pip thing in another environment and report if it's having the same issues.

@edublancas edublancas reopened this May 9, 2024
@edublancas
Copy link
Contributor

I reproduced the error:

conda create --channel conda-forge --name jupybug python=3.10 jupyterlab jupyter notebook jupysql
conda activate jupybug

Yields:

[W 2024-05-09 08:24:17.892 ServerApp] jupysql_plugin | extension failed loading with message: ExtensionLoadingError('_load_jupyter_server_extension function was not found.')
    Traceback (most recent call last):
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 360, in load_extension
        extension.load_all_points(self.serverapp)
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 232, in load_all_points
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 232, in <listcomp>
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 223, in load_point
        return point.load(serverapp)
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 150, in load
        loader = self._get_loader()
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/manager.py", line 119, in _get_loader
        loader = get_loader(loc)
      File "/Users/eduardo/miniconda3/envs/jupybug/lib/python3.10/site-packages/jupyter_server/extension/utils.py", line 40, in get_loader
        raise ExtensionLoadingError(msg) from None
    jupyter_server.extension.utils.ExtensionLoadingError: _load_jupyter_server_extension function was not found.

I think this is actually a warning: shows in yellow and the extension works (ran the Format SQL button).

I now remember we had a user report this problem and the conclusion was the same (it's a warning). possibly due to a breaking change in JupyterLab. Does the extension work for you or is it broken?

@jbwhit
Copy link
Author

jbwhit commented May 9, 2024

The format SQL button works. Is there any other functionality that I should test?

@edublancas
Copy link
Contributor

No, the plugin has two features: format SQL and notebook sharing, but we're deprecating the latter so there's no point in testing that.

@edublancas
Copy link
Contributor

closing due to inactivity

@edublancas edublancas closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants