cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

exceptions.ImportError: cannot import name Module #441

Closed gagern closed 7 years ago

gagern commented 7 years ago

I'm having trouble starting a notebook server:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 7.3, Release Date: 2016-08-04                     │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
Please wait while the old SageNB Notebook server starts...
/usr/lib64/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.babel is deprecated, use flask_babel instead.
  .format(x=modname), ExtDeprecationWarning
The notebook files are stored in: sage_notebook.sagenb
┌────────────────────────────────────────────────┐
│                                                │
│ Open your web browser to http://localhost:8081 │
│                                                │
└────────────────────────────────────────────────┘
Executing twistd  --pidfile="sage_notebook.sagenb/sagenb.pid" -ny "sage_notebook.sagenb/twistedconf.tac"
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 657, in run
    runApp(config)
  File "/usr/lib64/python2.7/site-packages/twisted/scripts/twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()
  File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 389, in run
    self.application = self.createOrGetApplication()
  File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 454, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "/usr/lib64/python2.7/site-packages/twisted/application/app.py", line 465, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "/usr/lib64/python2.7/site-packages/twisted/application/service.py", line 403, in loadApplication
    application = sob.loadValueFromFile(filename, 'application', passphrase)
  File "/usr/lib64/python2.7/site-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile
    exec fileObj in d, d
  File "sage_notebook.sagenb/twistedconf.tac", line 13, in <module>
    import sagenb.flask_version.base as flask_base
  File "/usr/lib64/python2.7/site-packages/sagenb/flask_version/base.py", line 4, in <module>
    from flask import Flask, Module, url_for, request, session, redirect, g, make_response, current_app, render_template
exceptions.ImportError: cannot import name Module

Failed to load application: cannot import name Module

Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/sage-notebook", line 225, in <module>
    launcher(unknown)
  File "/usr/lib/python-exec/python2.7/sage-notebook", line 74, in __init__
    notebook(*self.args, **self.kwds)
  File "/usr/lib64/python2.7/site-packages/sagenb/notebook/notebook_object.py", line 239, in __call__
    return self.notebook(*args, **kwds)
  File "/usr/lib64/python2.7/site-packages/sagenb/notebook/run_notebook.py", line 640, in notebook_run
    raise socket.error
socket.error

I guess it's due to dev-python/flask-0.11.1 not providing a flask.Module class. http://flask.pocoo.org/docs/0.11/changelog/ writes “Removed deprecated module functionality”. So perhaps sage-notebook should explicitely depend on flask <0.11? But seeing how the HOMEPAGE http://nb.sagemath.org appears to be gone, too, perhaps the old sage notebook is a dead end, even though I got quite used to it. If so, you might even consider dropping it.

kiwifb commented 7 years ago

The old notebook is definitely getting deprecated. But it is still there zombie style. Fortunately I think Jeroen and I have disentangled all the bits that were needed in sage from sagenb. There still seems to be a need of something being present to build the documentation. I'll have to look it closer. But first thing, will be to fix the dependency for now. The new jupyter notebook should work and there is a conversion tool in the overlay ExportSageNB.

gagern commented 7 years ago

Jupyter failed to start for me as well, but that was due to outdated tornado installed in ~/.local, so I could fix that by uninstalling this local copy. Now I have at least some notebook to work with :-)