anaconda / nb_conda_kernels

Package for managing conda environment-based kernels inside of Jupyter
BSD 3-Clause "New" or "Revised" License
599 stars 70 forks source link

Kernal provisioner not available #209

Closed singhavneet447 closed 8 months ago

singhavneet447 commented 3 years ago

I have been using jupyter notebook in Miniconda for over an year now. I have Python and R Kernels installed, but suddenly I cant use them. Jupyter notebooks launches, but there's no Kernel there. I see following error in cmd:

[I 02:30:29.663 NotebookApp] Serving notebooks from local directory: C:\Users\AVNEET\Conda-pr\Sample_Project_1
[I 02:30:29.666 NotebookApp] Jupyter Notebook 6.4.3 is running at:
[I 02:30:29.667 NotebookApp] http://localhost:8888/?token=5f7a143fe7ccd8b1e73a812738f671cbc17afdced8b1dc77
[I 02:30:29.667 NotebookApp]  or http://127.0.0.1:8888/?token=5f7a143fe7ccd8b1e73a812738f671cbc17afdced8b1dc77
[I 02:30:29.667 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 02:30:29.934 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/AVNEET/AppData/Roaming/jupyter/runtime/nbserver-1168-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=5f7a143fe7ccd8b1e73a812738f671cbc17afdced8b1dc77
     or http://127.0.0.1:8888/?token=5f7a143fe7ccd8b1e73a812738f671cbc17afdced8b1dc77
[W 02:30:38.672 NotebookApp] Kernel 'R' is referencing a kernel provisioner ('local-provisioner') that is not available.  Ensure the appropriate package has been installed and retry.
[W 02:30:52.896 NotebookApp] Kernel 'Python 3 (ipykernel)' is referencing a kernel provisioner ('local-provisioner') that is not available.  Ensure the appropriate package has been installed and retry.
C:\Users\AVNEET\miniconda3\lib\json\encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
  return _iterencode(o, 0)

Any insight is really appreciated.

kevin-bates commented 3 years ago

Hi @singhavneet447 - this is due to some kind of issue where the entrypoints within the juptyer_client 7.0 are not getting installed. Since the local-provisioner is introduced via an entrypoint in that package and represents the kernel provisioner to use when no other provisioners are registered or configured, the system is unable start default kernel configurations.

This forum post contains the resolution, which is to essentially reinstall the jupyter_client package: 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

Do you happen to know how your version of jupyter_client 7.0 was originally installed or came about? It would be good to get a better understanding of how the package can be installed w/o entrypoint registration.

Perhaps there's a way we (jupyter_client) can detect that it's the local-provisioner that is not found and, if so, attempt to construct the entrypoint instance on the fly.

kevin-bates commented 3 years ago

This appears to be due to the previous dist-info directory remaining behind following the installation of jupyter_client 7.0. I have created a pull request to detect and get past this particular scenario (see link prior to this comment).

kevin-bates commented 3 years ago

Update: jupyter_client 7.0.3 contains detection and dynamic creation of the local-provisoner to address these situations: https://pypi.org/project/jupyter-client/

This issue can be closed.