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

No such comm: hv-extension-comm error in cmd prompt #3805

Closed
WilliamBLeonard opened this issue Jul 5, 2019 · 24 comments
Closed

No such comm: hv-extension-comm error in cmd prompt #3805

WilliamBLeonard opened this issue Jul 5, 2019 · 24 comments
Assignees

Comments

@WilliamBLeonard
Copy link

The message '[IPKernelApp] WARNING | No such comm: hv-extension-comm' has started appearing in my cmd prompt when trying to run a certain Jupyter notebook. However, it does not cause errors to appear in my browser console, and it does not stop the panel-based pipeline in the notebook from running correctly through all stages when prompted.

During the running of the same Jupyter notebook, I have started experiencing issues with visualizations using geoviews, so that images of shapefiles that previously appeared normally with the same code now appear blurry, are distorted, and show weird coloration. Therefore, I am making an initial assumption that the issue is related to the hv-extension-comm message that has started appearing in my cmd prompt.

The code that I am using to visualize is as follows near the end of a function:

shape_viz_p1 = gv.Shape.from_shapefile(self.file_param)
shape_viz_p2 = datashade(shape_viz_p1, cmap=["blue"], precompute=True)* gvts.EsriImagery
return pn.panel(shape_viz_p1)

The file path is valid (and I have tried using multiple shape files). The problem with the image being distorted occurs even in another notebook I am using that was previously producing a "normal" image. Also, the problem occurs regardless of whether or not I impose the overlay with EsriImagery.

No error message is produced in a traceback; the only indications of an issue are the message in the cmd prompt and the distorted image.

Please advise if you need any more info to assist. Thanks!

@WilliamBLeonard
Copy link
Author

I see that the issue was previously mentioned in the now-closed issue of #3617, but no information is provided about what was done to resolve the issue there beyond the "solution" of placing code into another notebook.

@kcpevey
Copy link
Collaborator

kcpevey commented Jul 16, 2019

@WilliamBLeonard Have you looked into possible projection issues?

@WilliamBLeonard
Copy link
Author

@kcpevey I have not; I just noticed the hv error message appearing in the cmd prompt around the time this distorted shapefile image problem started, so I assumed they might be connected. The issue "resolved" itself on an initial run when I copied the content to a brand new notebook, so I thought it was related to issue #3617 based on reading that issue's history.

Do you have any suggested tests for seeing if it could be related to possible projection issues?

@mwal7
Copy link

mwal7 commented Dec 2, 2019

I'm also experiencing this error with a project using holoviews and geoviews:

[IPKernelApp] ERROR | No such comm target registered: hv-extension-comm
[IPKernelApp] WARNING | No such comm: hv-extension-comm

Since the author of #3617 thought it could be an update issue, I reinstalled holoviews 1.11.1 but I'm getting the same error. The errors occur when I import the packages, and when trying to render a geoviews plot the kernel ends up restarting and renders nothing. I'm in a virtual environment and just two months ago was able to use it successfully. I think a few packages in my virtualenv have been updated since then. I'm also seeing these errors in the terminal but assume they are unrelated.

NotebookApp] 404 GET /nbextensions/nbextensions_configurator/config_menu/main
NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js

@philippjfr
Copy link
Member

The No such comm warning/error is almost certainly unrelated to issues rendering anything. It's a harmless (if very annoying warning).

I reinstalled holoviews 1.11.1

This is quite out of date at this point, the current version is 1.12.6.

@philippjfr
Copy link
Member

trying to render a geoviews plot the kernel ends up restarting and renders nothing

This indicates some segmentation fault in one of the underlying geo libraries and not geoviews itself.

@mwal7
Copy link

mwal7 commented Dec 3, 2019

Thanks for your quick response @philippjfr

I upgraded back to the current version of holoviews and will continue investigating and trying to get a working script.

@philippjfr
Copy link
Member

I'd try importing some underlying libraries and seeing what crashes the kernel, start with:

  • cartopy
  • fiona
  • shapely
  • geopandas

@mwal7
Copy link

mwal7 commented Dec 3, 2019

All import fine. I just ran through the basic example of displaying geoviews features land and coastline (first example from the geoviews homepage) and doing so kills the kernel.

@philippjfr
Copy link
Member

Okay, also try import datashader.

@mwal7
Copy link

mwal7 commented Dec 3, 2019

Datashader also imports without error

@rwayan
Copy link

rwayan commented Feb 6, 2020

did it fixed i had same problem here

@spacescientist
Copy link

spacescientist commented Mar 17, 2020

EDIT [different problem, only showing the same error message]

I've encountered a similar error message today with a .ipynb file which works perfectly on my desktop, but leads to these errors/warnings on my new laptop.

The console printed not only [IPKernelApp] ERROR | No such comm target registered: hv-extension-comm and [IPKernelApp] WARNING | No such comm: hv-extension-comm, but also const geos::geom::CoordinateSequence* geos::geom::LineString::getCoordinatesRO() const: Assertion `nullptr != points.get()' failed..
Meanwhile in Jupyter, I got The kernel appears to have died. It will restart automatically..

After trying all kinds of things such as the ones above, that did not help fix my installation, I've done a good old history | grep on the desktop, and luckily recovered what I used at the time I first installed holoviews/geoviews on that machine. Here is the sequence:

pip install h5netcdf
pip install cartopy
pip install scikit-image
pip install sympy
pip install pyviz
pip install dask
pip install geoviews
pip install geopandas
pip install --upgrade pip
pip install --upgrade jupyter

While all of these are obviously not required (e.g. sympy), the solution is somewhere there ^, for me at least. I copied/pasted that on the laptop and everything now appears to work as expected (that is: at least a figure is shown and the kernel no longer dies).
I hope that might help other people (and perhaps also the future me).

Cheers.

@philippjfr
Copy link
Member

The geos errors are real, completely unrelated to the comm warning (which is completely harmless) and should be filed separately.

@spacescientist
Copy link

spacescientist commented Mar 17, 2020

Oh my bad, I've edited my reply for clarity.

Still, note that for instance with the bokeh xarray_image.ipynb example, which never gave any geos error, I also had the recurrent dying kernel issue with no other information than these exact same hv-extension-comm warnings and error, which led me to this thread. Installing those packages seemed to have fixed that at least, as it now displays the figures and they look reasonable.

Even if it's different from the problem the OP described, it does seem very similar to what @mwal7 described. Cheers.

PS: Oh, and actually even for the other file, the geos error has now disappeared.

@philippjfr
Copy link
Member

No problem at all. What @mwal7 described was also unrelated. I totally understand what led you here though, the continued pain installing the geo-stack makes you chase up any visible errors/warnings you see.

@thomasaarholt
Copy link

Adding another data point here. I just installed adaptive, which also installed holoviews. Running code in cells, and then rerunning the cells seems to lead to the above issue. The following is a list of packages that were downloaded upon installing adaptive.

    adaptive-0.11.1            |   py37h03978a9_2         152 KB  conda-forge
    colorcet-2.0.1             |             py_0         1.5 MB  conda-forge
    cudnn-7.6.5.32             |       h2cb8ba8_1       226.1 MB  conda-forge
    holoviews-1.14.0           |     pyhd3deb0d_0         3.4 MB  conda-forge
    loky-2.9.0                 |     pyh9f0ad1d_0          51 KB  conda-forge
    markdown-3.3.3             |     pyh9f0ad1d_0          66 KB  conda-forge
    panel-0.10.2               |     pyhd8ed1ab_0         6.0 MB  conda-forge
    param-1.10.0               |             py_0          64 KB  conda-forge
    pyct-0.4.6                 |             py_0           3 KB  conda-forge
    pyct-core-0.4.6            |             py_0          13 KB  conda-forge
    pyviz_comms-0.7.6          |     pyh9f0ad1d_0          13 KB  conda-forge
    sortedcollections-1.2.1    |     pyh9f0ad1d_0          10 KB  conda-forge

@jbednar
Copy link
Member

jbednar commented Dec 18, 2020

Just to be sure it's clear, this Github issue is about bogus messages that you see saying "No such comm target registered: hv-extension-comm" or "No such comm: hv-extension-comm". The messages are themselves the actual issue, not a symptom of some other problem, because the messages are alarming while not indicating any actual error. Users often post these messages when they encounter a real problem, in the hopes that the messages will help debug that problem, but really those messages are a "red herring" that is unrelated to whatever problem is happening for that user. So any "solution" in any of the issues linked here is not a solution to this issue, i.e. that the messages are printed at all, which remains unsolved.

I personally would pay $500 USD to anyone who can make these messages go away safely (i.e. without obscuring other messages that do actually mean something). Any takers?

@cpalacios1965
Copy link

I had the same problem and it was solved installing holoviews again. See: https://holoviews.org/user_guide/Installing_and_Configuring.html

@jamestwebber
Copy link

jamestwebber commented Jun 20, 2021

I personally would pay $500 USD to anyone who can make these messages go away safely (i.e. without obscuring other messages that do actually mean something). Any takers?

I can reproduce this warning with the following procedure:

  1. Import holoviews and create a plot, e.g.
import holoviews as hv
import numpy as np
hv.extension('bokeh')

N = 100
x = np.random.normal(size=N)
y = np.random.normal(size=N)

hv.Points((x, y))
  1. Restart the kernel and execute the cell again. EDIT: if you restart and clear outputs, the error shows up immediately.

The error doesn't show up the first time, and it doesn't show up if the hv.extension('bokeh') statement is in a different cell from the plot. I imagine this is why it's so commonly seen in issues, since it will appear most often when trying to debug something with a short example.

Inspecting the error, it is indeed calling CommManager.comm_open() before hv-extension-comm has been registered as a target (it gets registered after).

This seems like perhaps different JS components are in a race with each other? Although it's very consistent so the race is pretty one-sided.

@jbednar
Copy link
Member

jbednar commented Jun 20, 2021

Open a PR to fix it and earn $500 🙂

@marscher
Copy link

installing panel itself does not drag in holoviz, yielding the same error message trying to instantiate simple parameterized classes. Installing it manually solves the problem. (just stumbled upon this issue via a search for the error message). Sorry for the noise.

@ethan-tau
Copy link

@jbednar : out of curiosity, did anyone claim your bounty?

@jbednar
Copy link
Member

jbednar commented Jan 20, 2022

Nope; still open and ready to be claimed!

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