annotation interface not refreshed when different command is run

I have installed prodigy and the jupyter-lab extension in a virtual environment in Anaconda on a Windows 10 machine (see screenshot 1 below). I'm having a number of problems accessing the annotation interface, similar to some previous posts but none of the fixes seem to solve my issue.

  1. When trying to run prodigy commands from within my notebook the annotation interface doesn't open in the extension tool, but says "localhost refused to connect". (see screenshot 1 below)

  2. I see an error for attempting to bind to a socket in use (see screenshot 1 below) but the annotation can then be opened in the browser at that address

  3. Changing the url in settings doesn't seem to change which socket is used when prodigy is called (see screenshot 2 below)

  4. The main issue is that if I start a new prodigy session with a different dataset/labels/etc this does not reflect in the annotation session which opens. (see screenshot 3 below, which is the result of the second command in screenshot 1) I always get the original session open again, even though I can see that a new dataset has been recorded in prodigy datasets. This cleared after a pc restart, but nothing less than that seemed to refresh the interface.

Any ideas how I could find the source of these problems?

Hi! I think the main problem here comes down to how Jupyter handles processes like a web server started from within a cell: when you run the command again, it looks like the previous process wasn't terminated, so it's still running on that port. This is why the other command won't start the web server – but it'll still run everything that happens before that, including the recipe code and adding the dataset to the database.

In general, you should be able to just stop the process running in that cell. Also see this thread

Thanks Ines, I just tried the fix in the linked thread out and can confirm that solved the main problem (jupyter wouldn't stop the cell in the usual way).

1 Like