nteract / scrapbook

A library for recording and reading data in notebooks.

Home Page:https://nteract-scrapbook.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatible with JupyterLab

rjdoubleu opened this issue · comments

I have verified compatibility of the library in Jupyter Notebooks but for some reason when I use JupyterLab on the same kernel I receive the following:

In Cell:
import scrapbook as sb
dir(sb)

Out Cell:
['__doc__',
'__file__',
'__loader__',
'__name__',
'__package__',
'__path__',
'__spec__']

I am working in an Anaconda environment using the following installation method:

In Cell:
!pip install --upgrade nteract-scrapbook

Was the install the first cell of the notebook? Did you try restarting the kernel after installing? Is pip installing into your conda environment?

Installing or upgrading packages after they're already loaded into memory will oftentimes result in a failure. Sometimes other code will import packages in the background which causes the same issue. Try install the dependency before you launch the kernel or restart after. If you do install from the notebook I would highly recommend using the magics described here: https://jakevdp.github.io/blog/2017/12/05/installing-python-packages-from-jupyter/ instead of !pip calls. See if looking into those things fixes the issue for you.

I've resolved the issue: I simply ran !pip install scrapbook earlier in my script and the import statement was pointing to that package.