koaning / human-learn

Natural Intelligence is still a pretty good idea.
https://koaning.github.io/human-learn/
MIT License
800 stars 54 forks source link

Unable to draw in jupyter lab #68

Closed zzzbobml closed 3 years ago

zzzbobml commented 3 years ago

When I click for drawing as per this example, nothing happens. I've already enabled %matplotlib. Am I missing some other initialization?

koaning commented 3 years ago

I think you're trying to draw the interactive chart, which is based on bokeh, not matplotlib.

Are you hsing jupyterlab or colab? Colab doesn't support bokeh unfortunately.

koaning commented 3 years ago

Could you share some code/screenshot/traceback that might help to explain what is going wrong?

CYang828 commented 3 years ago

show nothing in jupyter lab

human-learn==0.3.1
jupyterlab==3.1.10

image

CYang828 commented 3 years ago

show nothing too image

koaning commented 3 years ago

Ah, you're tring to replicate the bulk-labelling demo. Technically, that's another repo. But let's see.

Can you confirm that you're running everything on port 8888? Per this issue.

koaning commented 3 years ago

In this case, could you also just try running human-learn without all the extra ipywidgets? That sure makes debugging a lot easier.

koaning commented 3 years ago

I can confirm something is up. It seems like bokeh and jupyter no longer play nice with each other.

koaning commented 3 years ago

OK. I just investigated and here's what I'm concluding.

  1. It does seem to work when I run it on my Linux machine.
  2. It does not seem to work when I run it on my Linux machine, but over SSH. It seems bokeh starts up a separate process and service that is handling all the rendering. Since my SSH port only opens up port 8888, it's blocking the ports from bokeh.

Just to confirm, @BSlience does this maybe explain whats happening on your end?

Borg93 commented 3 years ago

image getting the same error that I'm not able to select anything..

koaning commented 3 years ago

Just to make sure, you're able to make shapes by double-clicking? Just want to exclude that it's a UI-thing.

Borg93 commented 3 years ago

Damn, you're right. I just saw the instructions inside the source code! Works :)

roddyfue commented 2 years ago

I was facing this same issue when running over ssh and was able to solve it by forwarding the appropriate port and modifying the InteractiveCharts class to take the port as a parameter when calling show() on the bokeh chart