newaetech / chipwhisperer-jupyter

Interactive ChipWhisperer tutorials using Jupyter notebooks.
220 stars 70 forks source link

notebook needs to be pinned at <= 6.5.5 because "ModuleNotFoundError: No module named 'notebook.base'" in notebook >= 7.0.0 #47

Closed 46cv8 closed 11 months ago

46cv8 commented 1 year ago

notebook needs to be pinned at <= 6.5.5 because "ModuleNotFoundError: No module named 'notebook.base'" in notebook >= 7.0.0 perhaps this belongs in chipwhisperer-jupyter requirements.txt not sure

https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator/issues/164

pip install notebook==6.5.5

[E 2023-08-16 15:03:18.848 ServerApp] Uncaught exception GET /api/nbconvert?1692165798678 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/nbconvert?1692165798678', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/jupyter_server/services/nbconvert/handlers.py", line 40, in get
        exporters = await run_sync(base.get_export_names)
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
        return await get_asynclib().run_sync_in_worker_thread(
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
        return await future
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
        result = context.run(func, *args)
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/nbconvert/exporters/base.py", line 150, in get_export_names
        e = get_exporter(exporter_name)(config=config)
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/nbconvert/exporters/base.py", line 109, in get_exporter
        exporter = [e for e in exporters if e.name == name or e.name == name.lower()][0].load()
      File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
        module = import_module(match.group('module'))
      File "/home/user/.pyenv/versions/3.10.12/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/jupyter_contrib_nbextensions/__init__.py", line 5, in <module>
        import jupyter_nbextensions_configurator
      File "/home/user/.pyenv/versions/cw/lib/python3.10/site-packages/jupyter_nbextensions_configurator/__init__.py", line 18, in <module>
        from notebook.base.handlers import APIHandler, IPythonHandler
    ModuleNotFoundError: No module named 'notebook.base'
46cv8 commented 1 year ago

Similar issue with bokeh module. The jupyter notebook "[02 - Husky Triggers.ipynb]" is broken on newer versions of the "bokeh" library because they don't have "plot_width". You need to pin the version as below or update the notebook. bokeh==2.4.3

alex-dewar commented 1 year ago

Thanks for bringing this to our attention. I've pinned both bokeh and notebook in requirements.txt and the install seems to work on a fresh 3.9.5 pyenv.