Opened 9 months ago

Closed 9 months ago

#69419 closed defect (fixed)

py310-notebook will not start

Reported by: dershow Owned by: jjstickel (Jonathan Stickel)
Priority: Normal Milestone:
Component: ports Version:
Keywords: jupyter Cc: stromnov (Andrey Stromnov), Michael-P-Allen (Mike Allen), jjstickel (Jonathan Stickel)
Port: py310-notebook

Description

The recent upgrade to some part of jupyter have broken py310-notebook (and 311 and 312)

% jupyter-notebook-3.10
Traceback (most recent call last):
  File "/opt/local/bin/jupyter-notebook-3.10", line 33, in <module>
    sys.exit(load_entry_point('notebook==6.4.11', 'console_scripts', 'jupyter-notebook')())
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/jupyter_core/application.py", line 283, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/config/application.py", line 1042, in launch_instance
    app.initialize(argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/traitlets/config/application.py", line 113, in inner
    return method(app, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notebook/notebookapp.py", line 2149, in initialize
    self.init_webapp()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notebook/notebookapp.py", line 1757, in init_webapp
    self.web_app = NotebookWebApplication(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notebook/notebookapp.py", line 177, in __init__
    settings = self.init_settings(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notebook/notebookapp.py", line 300, in init_settings
    nbextensions_path=jupyter_app.nbextensions_path,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/notebook/notebookapp.py", line 1327, in nbextensions_path
    from IPython.paths import get_ipython_dir
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/terminal/embed.py", line 15, in <module>
    from IPython.core.interactiveshell import DummyMod, InteractiveShell
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 326, in <module>
    class InteractiveShell(SingletonConfigurable):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 331, in InteractiveShell
    ast_transformers: List[ast.NodeTransformer] = List(
TypeError: 'type' object is not subscriptable

There are a few other open jupyter ticket that might be related?

https://trac.macports.org/ticket/69244 [https://trac.macports.org/ticket/69415 ] https://trac.macports.org/ticket/69416 https://trac.macports.org/ticket/69357

Any help getting notebook to run would be appreciated.

Change History (8)

comment:1 Changed 9 months ago by albcn

This bug has been here for several weeks.

To me, editing (for 3.11, modify your version).

/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/notebook/traittypes.py 

And manually changing

from traitlets import ClassBasedTraitType, Undefined, warn

to

from warnings import warn
from traitlets import ClassBasedTraitType, Undefined

makes it work. This looks better to me than installing the package via pip.

pip uninstall traitlets
pip install traitlets==5.9.0

as mentioned in other reports.

This is related to https://github.com/SlackBuildsOrg/slackbuilds/pull/4227/commits/a9e3da223116adb32dc98f78f1ae3cb8dc61f96c

comment:2 Changed 9 months ago by Michael-P-Allen (Mike Allen)

Cc: Michael-P-Allen added

comment:3 Changed 9 months ago by dershow

For the traitlets issue https://trac.macports.org/ticket/69244 I was able to just go back to the older version of traitlets from Macports. (I downloaded the 5.9 portfile) and that was a good workaround.

So, I'm still using 5.9 but as of yesterday, with an upgrade in jupyter (-lab? Notebook? some other piece?) I can get notebook to open.

so I don't think that this is the same as the few week old one that you mentioned.

comment:4 Changed 9 months ago by dershow

I tried the edit that @albcn suggested and I still get the same error when I try to startup jupyter-notebook. So, this is not the same.

comment:5 Changed 9 months ago by jjstickel (Jonathan Stickel)

Cc: jjstickel added

comment:6 Changed 9 months ago by jjstickel (Jonathan Stickel)

I implemented the patch suggested by @albcn in https://github.com/macports/macports-ports/pull/22859

comment:7 Changed 9 months ago by jjstickel (Jonathan Stickel)

This ticket looks like a duplicate of https://trac.macports.org/ticket/69244

comment:8 Changed 9 months ago by jjstickel (Jonathan Stickel)

Owner: set to jjstickel
Resolution: fixed
Status: newclosed

In cd336b6cea930682ce7b84770eb8b8730d13ae8f/macports-ports (master):

py-notebook: patch for traitlets >5.9.0

  • patch to workaround moving of warn submodule

Closes: #69419

Note: See TracTickets for help on using tickets.