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

Kernel Provisioning: The 'local-provisioner' is not found. #800

Closed
utkonos opened this issue Jun 6, 2022 · 6 comments
Closed

Kernel Provisioning: The 'local-provisioner' is not found. #800

utkonos opened this issue Jun 6, 2022 · 6 comments

Comments

@utkonos
Copy link
Contributor

utkonos commented Jun 6, 2022

I'm encountering a problem after the update to jupyter_client 7.3.2. The following error is appearing:

[W 2022-06-06 17:10:09.080 ServerApp] Kernel Provisioning: The 'local-provisioner' is not found.  This is likely due to the presence of multiple jupyter_client distributions and a previous distribution is being used as the source for entrypoints - which does not include 'local-provisioner'.  That distribution should be removed such that only the version-appropriate distribution remains (version >= 7).  Until then, a 'local-provisioner' entrypoint will be automatically constructed and used.
    The candidate distribution locations are: ['/home/jupyter/venv/lib/python3.10/site-packages/jupyter_client-7.3.2.dist-info']

I found a thread with a similar problem from last year:
https://discourse.jupyter.org/t/kernel-python-3-is-referencing-a-kernel-provisioner-local-provisioner-that-is-not-available-ensure-the-appropriate-package-has-been-installed-and-retry/10436/9

pip install --force-reinstall jupyter_client didn't help. Also, I've looked in {sys.prefix}/lib/pythonX.Y/site-packaes as was recommended, but I don't see a second directory.

I will probably delete the virtual environment and reinstall the whole jupyter instance from pip install jupyter to see if that fixes it.

@utkonos
Copy link
Contributor Author

utkonos commented Jun 6, 2022

This message appears after a clean install to a virtual environment.

@kevin-bates
Copy link
Member

Hi @utkonos.

I'm encountering a problem after the update to jupyter_client 7.3.2.

When you updated jupyter_client, were you using jupyter_client 6.x prior to this particular update?

This message appears after a clean install to a virtual environment.

I'm not familiar with virtual environments, but I wonder if it's a similar thing where the entrypoints package sees the distribution from, in this case, another (base?) virtual environment or something.

@kevin-bates
Copy link
Member

kevin-bates commented Jun 6, 2022

Actually, I see the issue and it's independent of how the python env is setup (venv or conda).

In 7.3.2 the entry_points.txt file that is in the referenced dist-info directory is missing the [jupyter_client.kernel_provisioners] group entry:

[console_scripts]
jupyter-kernel = jupyter_client.kernelapp:main
jupyter-kernelspec = jupyter_client.kernelspecapp:KernelSpecApp.launch_instance
jupyter-run = jupyter_client.runapp:RunApp.launch_instance

Whereas 7.3.1 has the following content:

[console_scripts]
jupyter-kernel = jupyter_client.kernelapp:main
jupyter-kernelspec = jupyter_client.kernelspecapp:KernelSpecApp.launch_instance
jupyter-run = jupyter_client.runapp:RunApp.launch_instance

[jupyter_client.kernel_provisioners]
local-provisioner = jupyter_client.provisioning:LocalProvisioner

I suspect this is due to the changes to use flit in #781 where this stanza of the entrypoints got dropped when setup.py was deleted:
image
cc: @blink1073

@utkonos
Copy link
Contributor Author

utkonos commented Jun 6, 2022

Thanks! I see that. That looks like the root cause of the message.

I'm looking at
https://flit.pypa.io/en/latest/pyproject_toml.html#entry-points-sections

I use entry points in my own projects, but I am still using setup.cfg at the moment. I have not moved these components to a pyproject.toml file yet. Let me know if I have this correct. This should be added to pyproject.toml?

[project.entry-points."jupyter_client.kernel_provisioners"]
local-provisioner = "jupyter_client.provisioning:LocalProvisioner"

Or is this missing for a specific reason and should not be added to the pyproject.toml?

@kevin-bates
Copy link
Member

kevin-bates commented Jun 6, 2022

Yes, that is correct. I have confirmed it works, but if you'd like to make the contribution, I'd be happy to shepherd it through!

You'll have to uninstall the current jupyter_client to get the dev version to install.

@utkonos
Copy link
Contributor Author

utkonos commented Jun 6, 2022

@kevin-bates PR coming right up. One sec.

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

2 participants