notebook does not work

82 views
Skip to first unread message

czsan

unread,
Jun 4, 2016, 9:14:15 AM6/4/16
to sage-devel
After upgrading de notebook indicates the following error:

sage: notebook()
The notebook files are stored in: sage_notebook.sagenb
┌────────────────────────────────────────────────┐
│                                                │
│ Open your web browser to http://localhost:8080
│                                                │
└────────────────────────────────────────────────┘
Executing twistd  --pidfile="sage_notebook.sagenb/sagenb.pid" -ny "sage_notebook.sagenb/twistedconf.tac"
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/application/app.py", line 643, in run
    runApp(config)
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/scripts/twistd.py", line 25, in runApp
    _SomeApplicationRunner(config).run()
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/application/app.py", line 374, in run
    self.application = self.createOrGetApplication()
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/application/app.py", line 439, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/application/app.py", line 450, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/application/service.py", line 411, in loadApplication
    passphrase)
  File "/usr/lib/python3.5/site-packages/Twisted-16.2.0-py3.5.egg/twisted/persisted/sob.py", line 223, in loadValueFromFile
    codeObj = compile(data, filename, "exec")
builtins.SyntaxError: Missing parentheses in call to 'print' (twistedconf.tac, line 21)


Failed to load application: Missing parentheses in call to 'print' (twistedconf.tac, line 21)

---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-1-3728cb3d7c7d> in <module>()
----> 1 notebook()

/usr/share/sage/source/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (/build/sagemath/src/sage-7.2/src/build/cythonized/sage/misc/lazy_import.c:3629)()
    384             True
    385         """
--> 386         return self._get_object()(*args, **kwds)
    387
    388     def __repr__(self):

/usr/lib/python2.7/site-packages/sagenb/notebook/notebook_object.pyc in __call__(self, *args, **kwds)
    237     """
    238     def __call__(self, *args, **kwds):
--> 239         return self.notebook(*args, **kwds)
    240
    241     notebook = run_notebook.notebook_run

/usr/lib/python2.7/site-packages/sagenb/notebook/run_notebook.pyc in notebook_run(self, directory, port, interface, port_tries, secure, reset, accounts, openid, server_pool, ulimit, timeout, doc_timeout, upload, automatic_login, start_path, fork, quiet, server, profile, subnets, require_login, open_viewer, address)
    638     os.chdir(cwd)
    639     if e == 256:
--> 640         raise socket.error
    641
    642 def get_admin_passwd():

error:

This happens with other notebooks.


Dima Pasechnik

unread,
Jun 4, 2016, 10:18:45 AM6/4/16
to sage-devel
what Sage version is this?

Sándor Czirbusz

unread,
Jun 4, 2016, 10:34:47 AM6/4/16
to sage-...@googlegroups.com
Hi,

I use Antergos (arch linux), and sagemath is fresh, namely 7.2 (Release Date: 2016-05-15 ).

At 2016-05-15 I  have saved some worksheets, but from this time the notebook does not work.

CzS

--
You received this message because you are subscribed to a topic in the Google Groups "sage-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-devel/E_12pSeCwbU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Sándor Czirbusz

unread,
Jun 4, 2016, 11:38:53 AM6/4/16
to sage-...@googlegroups.com
more precisly

<table width="100%" style="border:solid black 1px"> ' starts the table at 100% of the page width
  <TR>
  <TD>
This is the first cell info
</TD> 'this closes the first cell
<TD> 'this is the start of the second "cell"
This is the second cell info
</TD> 'this closes the second cell
<TD> 'this is the start of the third "cell"
This is the first third info
</TD> 'this closes the third cell
</TR> 'this closes the first row
</TABLE> 'this closes the table
sagemath            7.2-4
sagemath-doc     7.2-2
sagemath-src      7.2-4

Dima Pasechnik

unread,
Jun 4, 2016, 1:23:24 PM6/4/16
to sage-devel
Is your Sage built from source, or you downloaded a binary installation?

Anyway, I see what happens. For some strange reason it picks up wrong Twisted, the one for Python 3.
You can see it from the log below, and the error message is the one you get by trying to use Python 2 style print statements in Python 3.
How could this have happened is a mystery to me.

Could you try (re)installing Sage's Twisted package, by running

sage -i twisted

and see if this helps?




On Saturday, June 4, 2016 at 2:14:15 PM UTC+1, czsan wrote:

Antonio Rojas

unread,
Jun 4, 2016, 1:39:47 PM6/4/16
to sage-...@googlegroups.com
Dima Pasechnik wrote:

> Is your Sage built from source, or you downloaded a binary installation?
>
> Anyway, I see what happens. For some strange reason it picks up wrong
> Twisted, the one for Python 3.
> You can see it from the log below, and the error message is the one you
> get by trying to use Python 2 style print statements in Python 3.
> How could this have happened is a mystery to me.
>
> Could you try (re)installing Sage's Twisted package, by running
>
> sage -i twisted
>
> and see if this helps?

From the paths it looks like they're using distro packages, so sage -i won't
work.
Have you (or Antergos) messed up with the python2-twisted package files? Do
you have a custom twisted installation?
Please post the output of "cat $(which twistd)"


Sándor Czirbusz

unread,
Jun 4, 2016, 1:41:52 PM6/4/16
to sage-...@googlegroups.com
sage -i twisted
make: *** No rule to make target 'all-toolchain'.  Stop.


Sándor Czirbusz

unread,
Jun 4, 2016, 1:45:42 PM6/4/16
to sage-...@googlegroups.com
This is the answer

# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import os, sys

try:
    import _preamble
except ImportError:
    try:
        sys.exc_clear()
    except AttributeError:
        # exc_clear() (and the requirement for it) has been removed from Py3
        pass

sys.path.insert(0, os.path.abspath(os.getcwd()))

from twisted.scripts.twistd import run
run()

Antonio Rojas

unread,
Jun 4, 2016, 1:51:33 PM6/4/16
to sage-...@googlegroups.com
Sándor Czirbusz wrote:

> This is the answer
>
> # Copyright (c) Twisted Matrix Laboratories.
> # See LICENSE for details.
> import os, sys
>
> try:
> import _preamble
> except ImportError:
> try:
> sys.exc_clear()
> except AttributeError:
> # exc_clear() (and the requirement for it) has been removed from
> # Py3
> pass
>
> sys.path.insert(0, os.path.abspath(os.getcwd()))
>
> from twisted.scripts.twistd import run
> run()

Did you cut off the first line? (that's the important one)

Sándor Czirbusz

unread,
Jun 4, 2016, 1:52:34 PM6/4/16
to sage-...@googlegroups.com
Ah, sorry
#!/usr/bin/python2


Antonio Rojas

unread,
Jun 4, 2016, 2:06:28 PM6/4/16
to sage-...@googlegroups.com
Sándor Czirbusz wrote:

> Ah, sorry
> #!/usr/bin/python2
>
>

That looks OK. Are you sure you don't have any other 'twistd' executable
lying around on your system?

Sándor Czirbusz

unread,
Jun 4, 2016, 2:13:40 PM6/4/16
to sage-...@googlegroups.com
You are the winner; I installed the python3 version too. Uninstall, and it seems, everything is OK.

I  tried with two notebook folder.

MANY MANY THANKS.

Reply all
Reply to author
Forward
0 new messages