Standalone notebook on EPD

24 views
Skip to first unread message

Pablo W.

unread,
Apr 22, 2011, 7:11:58 AM4/22/11
to sage-notebook
Hi,

I would like to run a Sage Notebook on top of a regular python
distribution (EPD70), to provide python programs to my coauthors.

I have rougly followed the steps described in this thread
http://groups.google.com/group/sage-release/browse_thread/thread/babfdde21838f409
The main difference was that I used the version of twisted distributed
with sage as it includes web2, which has apparently disappeared from
the
current version of twisted.
A also commented some line importing sage libraries and the _interact_
machine which was not imported properly.

Then I could run a notebook in IPython and the notebooks seem to run
fine except that it presents output in a weird way:

- small/simple commands are handled just fine
- any cell with an import statement will be evaluated correctly but
the
notebook will output an history of the embedded ipython kernel. For
instance, the following would appear after the evaluation cell

''
Enthought Python Distribution -- www.enthought.com
Version: 7.0-1 (64-bit)

Python 2.7.1 |EPD 7.0-1 (64-bit)| (r271:86832, Nov 29 2010, 13:51:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import os;os.chdir("/tmp/tmpvzNK6Z");
>>> execfile("_sage_input_1.py")
START1
Stub: InlineFortran
Stub: session_init
__SAGE__
__SAGE__import os;os.chdir("/tmp/tmpEArJYW");
__SAGE__execfile("_sage_input_2.py")
START2

import os;os.chdir("/tmp/tmpwSynTK");
execfile("_sage_input_3.py")
__SAGE__
__SAGE__import os;os.chdir("/tmp/tmpwSynTK");
__SAGE__execfile("_sage_input_3.py")
START3
__SAGE__
__SAGE__import os;os.chdir("/tmp/tmpwXCJne");
__SAGE__execfile("_sage_input_4.py")
START4
''

I'm wondering where this behaviour come from. I had a "look at the
code"
but I couldn't figure out which command was triggering the printing.

Do you have an idea ?

Best,

Pablo

Pablo W.

unread,
Jun 13, 2011, 5:37:52 AM6/13/11
to sage-notebook
Hi,

I guess I found the problem. It was not related to the python
interpreter, but to the version of pexpect. The
WorksheetProcess_ExpectImplementation implementation doesn't work with
latest version of pexpect (2.4). I am not sure whether it is
considered as a bug if pexpect is not to be updated in Sage.

More generally, I have a big interest in helping to make the sage
notebook run on a standard python distribution. Right now it doesn't
work to bad but there are still some glitches like:
- list of engines shows only 'sage', while it should be just 'python'
- printing functions (html, latex) are lost.

The last point is the most annoying, as I find html(..) and html.table
to be very handy functions. Has there be some work to bring them back
to the notebook ? If not, I would be glad to do it (if it's not too
complex).
I can also write down the current instructions to run sagenb on
independent python distribution.

Best,

Pablo

On Apr 22, 1:11 pm, "Pablo W." <pablo.win...@gmail.com> wrote:
> Hi,
>
> I would like to run a Sage Notebook on top of a regular python
> distribution (EPD70), to provide python programs to my coauthors.
>
> I have rougly followed the steps described in this threadhttp://groups.google.com/group/sage-release/browse_thread/thread/babf...
Reply all
Reply to author
Forward
0 new messages