CermakM / jupyter-datatables

Jupyter Notebook extension leveraging pandas DataFrames by integrating DataTables and ChartJS.
MIT License
238 stars 27 forks source link

Usage example fails #4

Closed ipcoder closed 5 years ago

ipcoder commented 5 years ago

Hi I have installed the package according to the recommendations. But the Usage example fails in two places:

import numpy as np
import pandas as pd

from jupyter-datatables import init_datatables_mode  #  1) fails here unless I change to underscore: jupyter_datatables

init_datatables_mode()  # fails here with ModuleNotFoundError: No module named 'jupyter_tools'

Full error listing :

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-5555e4cbac8b> in <module>
      2 import pandas as pd
      3 
----> 4 from jupyter_datatables import init_datatables_mode
      5 
      6 init_datatables_mode()

/opt/anaconda/envs/py36/lib/python3.6/site-packages/jupyter_datatables/__init__.py in <module>
     36 from pathlib import Path
     37 
---> 38 from jupyter_require import require
     39 
     40 from jupyter_require import link_css

/opt/anaconda/envs/py36/lib/python3.6/site-packages/jupyter_require/__init__.py in <module>
    127 
    128 
--> 129 _handle_ipython()

/opt/anaconda/envs/py36/lib/python3.6/site-packages/jupyter_require/__init__.py in _handle_ipython()
    115         return
    116 
--> 117     load_ipython_extension(ipython)
    118 
    119 

/opt/anaconda/envs/py36/lib/python3.6/site-packages/jupyter_require/__init__.py in load_ipython_extension(ipython)
     73 def load_ipython_extension(ipython):
     74     """Load the IPython Jupyter Require extension."""
---> 75     from .magic import RequireJSMagic
     76 
     77     logger.debug("Loading Jupyter Require extension.")

/opt/anaconda/envs/py36/lib/python3.6/site-packages/jupyter_require/magic.py in <module>
     32 from IPython.core.magic import needs_local_scope
     33 
---> 34 from jupyter_tools.utils import sanitize_namespace
     35 
     36 from .core import execute_with_requirements

ModuleNotFoundError: No module named 'jupyter_tools'
CermakM commented 5 years ago

Hello and thank you for trying out Jupyter DataTables!

The from jupyter-datatables import ... is, of course, a horrible typo, thanks for pointing that out!

And well... shrap, I completely forgot that I use jupyter-tools to sanitize the namespace. I will add it to the dependencies ASAP. In the meantime, since this is not yet a package in PyPI, you can install it from https://github.com/CermakM/jupyter-tools. I am sorry for the incovenience.

I recommend using the stable branch:

# replace pipenv with pip if you are in virtualenv already
pipenv install -e "git+https://github.com/CermakM/jupyter-tools@stable#egg=jupyter-tools" 
CermakM commented 5 years ago

The new release of jupyter-require includes the missing package, this issue should now be solved.

ipcoder commented 5 years ago

Thank you. I have tried adding it manually - with success. Now it will be a much smoother experience ;-)

CermakM commented 5 years ago

Thanks! Resolved. :)