Slicer/Jupyter integration: installing python packages

@lassoan thanks so much, will look forward!

I’ve reverted to last working version yesterday, so SlicerJupyter should work on MacOS on Slicer Preview Release you download today.

In the meantime, I’ve submitted a fix to xeus-jupyter if it gets integrated then we should be able to switch back to latest version again. I’m still investigating Windows build issue.

1 Like

Hi Andras,

SlicerJupyter seems to work now, except that hitting Tab doesn’t bring up the available methods by class. Do you know how I could fix this? Thanks

Type your line of code directly in the Python console of 3D slicer (where tab-completion works, at least for me) then copy/paste into Jupyter. Curiously, “itk” (with “import itk”) seems to give usable tab-completion in my Slicer/Jupyter setup, but almost anything else fails.

Tab-completion, documentation, etc. should all work well - see it on Binder: GitHub - Slicer/SlicerJupyter: Extension for 3D Slicer that allows the application to be used from Jupyter notebook

We recently updated our Python kernel base library (xeus-python), which has some trouble with Jedi integration and therefore features that rely on code inspection are currently broken. Hopefully we can fix them in the next few days.

Until then, you can use a Slicer version from a couple of weeks before. I’ve just tried this version and it works well: Download 3D Slicer | 3D Slicer

I was on 8-13 and tab completion didn’t work there; I’ll wait for the fix! The integration is otherwise hugely useful. Thanks.

Could you try 2020-08-10? What operating system do you use? Does tab completion work in Binder?

I’ve pushed a fix, please try it in tomorrow’s Slicer Preview Release (you need to uninstall and reinstall SlicerJupyter if no new Slicer core is released).

The change was not fully successful yesterday. I’ve refined it today and hopefully it’ll be all good tomorrow. Until then, there is a workaround to make auto-complete work. Run this in Slicer’s Python environment (in a notebook cell or in Slicer’s Python console):

pip_install('parso==0.7.1')

Latest Slicer Preview Release confirmed to work well (including auto-complete, method documentation, etc.).