which version of ipython for building a sagecell server

234 views
Skip to first unread message

mbuf...@gmail.com

unread,
Nov 13, 2013, 4:42:58 PM11/13/13
to sage-s...@googlegroups.com
I want to use the sage cellserver for online course with moodle.
I presently use the sagecell.sagemath.org, but I want to use my own sagecell  server at the university

I have try to compile the SAGE cellserver using the https://github.com/sagemath/sagecell
I successfully compile SAGE  5.10.rc1 on my ubuntu box 12.04
I then patch sage using
wget https://github.com/jasongrout/sage/commit/fdbe79ef7ed0ca0fa6c712c4c580ba34de1a1166.patch
wget https://github.com/jasongrout/sage/commit/c1ad5805558b15694d783bbb5c77296f2d492b2e.patch
patch --ignore-whitespace -p2 < fdbe79ef7ed0ca0fa6c712c4c580ba34de1a1166.patch
patch --ignore-whitespace -p2 < c1ad5805558b15694d783bbb5c77296f2d492b2e.patch
and install ipython
with easy_install ipython
and  Install the latest sagecell spkg
I have a running sage cell server, but it can only evaulate python, and not sage
typing: plot(x^3)
result to an error

ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
ERROR - failed to write data to stream: <IPython.kernel.zmq.iostream.OutStream object at 0x7368ad0>
ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home4/local/sage-5.10.rc1/local/lib/python2.7/site-packages/ipython-1.1.0-py2.7.egg/IPython/core/ultratb.py", line 1030, in __call__
.....

I have try to use sage 5.12, it compiles but does not work

The question is: what version of sage, and what version of ipython do I need to compile a working sage cellserver on ubuntu 12.04

Thanks
Marc

Jason Grout

unread,
Nov 13, 2013, 4:52:28 PM11/13/13
to sage-s...@googlegroups.com
On 11/13/13 3:42 PM, mbuf...@gmail.com wrote:
> I want to use the sage cellserver for online course with moodle.
> I presently use the sage*cell*.*sagemath*.org, but I want to use my own
> sagecell server at the university
>


Those instructions are old (sorry for not noting it yet). I'm now
running the cell server on CentOS 6.4, but we have some development
versions running on cloud.sagemath.com (which is running Ubuntu 12.04).

Here are the scripts I currently use for installing a virtual machine
with sage and the cell server (not very well-documented, I'm afraid):
https://github.com/sagemath/sagecell/tree/master/contrib/vm

In particular, here is the part that installs the sage cell server and sage:

https://github.com/sagemath/sagecell/blob/master/contrib/vm/install-sagecell-functions#L111

You can see at
https://github.com/sagemath/sagecell/blob/master/contrib/vm/install-sagecell-functions#L131
that I use the 'sagecell' branch of my github repository for sage
(https://github.com/jasongrout/sage/tree/sagecell) and at
https://github.com/sagemath/sagecell/blob/master/contrib/vm/install-sagecell-functions#L181
you see I use the sagecell branch in my github clone of IPython
(https://github.com/jasongrout/ipython/tree/sagecell).

It's not really documented well right now. I'm happy to give pointers,
though, and I'm more than happy to accept pull requests improving the
documentation and install process.

Thanks,

Jason


mbuf...@gmail.com

unread,
Nov 15, 2013, 4:32:37 PM11/15/13
to sage-s...@googlegroups.com
Jason

I have try to follow your instructions as:

mkdir sage
git init
git remote add -f jason https://github.com/jasongrout/sage.git
git checkout jason/sagecell
mkdir upstream
make

but I get a checksum error for Ipython

/home4/local/sage/build/pipestatus "sage-spkg ${SAGE_SPKG_OPTS} ipython-1.0.0 2>&1" "tee -a /home4/local/sage/logs/pkgs/ipython-1.0.0.log"
Found local metadata for ipython-1.0.0
Found local sources at /home4/local/sage/upstream/ipython-1.0.0.tar.gz
Checksum: a1b3033953e47027c9409e9c33c90c6a79ff640c  vs a1b3033953e47027c9409e9c33c90c6a79ff640c
Invalid checksum for /home4/local/sage/upstream/ipython-1.0.0.tar.gz
make[2]: *** [/home4/local/sage/local/var/lib/sage/installed/ipython-1.0.0] Erreur 1

Is the ipython version correct

Thanks
Marc

Jason Grout

unread,
Nov 16, 2013, 10:23:05 AM11/16/13
to sage-s...@googlegroups.com
On 11/15/13 3:32 PM, mbuf...@gmail.com wrote:
> Jason
>
> I have try to follow your instructions as:
>
> mkdir sage
> git init
> git remote add -f jason https://github.com/jasongrout/sage.git
>
> git checkout jason/sagecell
> mkdir upstream
> wget -O ipython-1.0.0.tar.gz
> https://github.com/ipython/ipython/releases/download/rel-1.0.0/ipython-1.0.0.tar.gz
> make
>


Basically, what you want to do is:

* use the git version of Sage, and in particular, my sagecell branch of
sage:

git clone https://github.com/jasongrout/sage.git
cd sage
git checkout origin/sagecell
make # this makes Sage and takes a long time
cd ..

You also want to update IPython to my sagecell branch:

git clone https://github.com/jasongrout/ipython.git
cd ipython
git checkout origin/sagecell
sage setup.py develop # assumes the sage above is in your path
cd ..

Then install the sagecell:

sage -i
http://sage.math.washington.edu/home/jason/sagecell-spkg/sagecell-2013-08-13.spkg
cd sagecell
git pull origin master
sage -sh -c "make -B"

Thanks,


Jason


mbuf...@gmail.com

unread,
Nov 16, 2013, 1:32:32 PM11/16/13
to sage-s...@googlegroups.com
Hi Jason
i follow your instructions but I get a first error when building sage:

Trying to download http://www.sagemath.org/packages/upstream//ipython/ipython-1.0.0.tar.bz2
IOError: [Errno 404] Not Found:

so I download python-1.0.0.tar.bz2 from githubs and put it on upstream
But I got the same invalid checksum error as before


Found local metadata for ipython-1.0.0
Found local sources at /home4/local/sage/upstream/ipython-1.0.0.tar.gz
Checksum: a1b3033953e47027c9409e9c33c90c6a79ff640c  vs a1b3033953e47027c9409e9c3
3c90c6a79ff640c
Invalid checksum for /home4/local/sage/upstream/ipython-1.0.0.tar.gz

I finally trace the problem. The  local file checksums.ini  exists in sage/build/pkgs/ipython
that contains the cheksum sha1 key for ipython -1.0.0
The key is identical to the ipython-1.0.0.tar.gz
Unfortunately, there is space at the end of the line, such that the comparison fails.
I correct the checksums.ini file (remove the additional space), and now I can compile sage without error
thanks
Marc

mbuf...@gmail.com

unread,
Nov 17, 2013, 4:55:12 PM11/17/13
to sage-s...@googlegroups.com

Hi
using the  link provided by Jason, I have a running version of sage and sagecell server on my ubuntu box
I can run python and sage program.
Plotting with sage is working
plot(x^3) draw the correct figure
however matplotlib is not working
import pylab
pylab.plot(X,Y)
pylab.show()
result in the following error TCLTK error (log followed)
TclError: no display name and no $DISPLAY environment variable
Have you any idea
THanks
Marc
===========================================================================
TclError Traceback (most recent call last) <ipython-input-1-291618d8b509> in <module>() 2 X=linspace(Integer(0),Integer(1),Integer(10)) 3 import pylab ----> 4 pylab.plot(X,X*X) 5 pylab.show() /home4/sage/local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pyplot.pyc in plot(*args, **kwargs) 3048 @_autogen_docstring(Axes.plot) 3049 def plot(*args, **kwargs): -> 3050 ax = gca() 3051 # allow callers to override the hold state by passing hold=True|False 3052 washold = ax.ishold() /home4/sage/local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pyplot.pyc in gca(**kwargs) 809 matplotlib.figure.Figure.gca : The figure's gca method. 810 """ --> 811 ax = gcf().gca(**kwargs) 812 return ax 813 /home4/sage/local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pyplot.pyc in gcf() 454 return figManager.canvas.figure 455 else: --> 456 return figure() 457 458 fignum_exists = _pylab_helpers.Gcf.has_fignum /home4/sage/local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/pyplot.pyc in figure(num, figsize, dpi, facecolor, edgecolor, frameon, FigureClass, **kwargs) 427 frameon=frameon, 428 FigureClass=FigureClass, --> 429 **kwargs) 430 431 if figLabel: /home4/sage/local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/backends/backend_tkagg.pyc in new_figure_manager(num, *args, **kwargs) 79 FigureClass = kwargs.pop('FigureClass', Figure) 80 figure = FigureClass(*args, **kwargs) ---> 81 return new_figure_manager_given_figure(num, figure) 82 83 /home4/sage/local/lib/python2.7/site-packages/matplotlib-1.4.x-py2.7-linux-x86_64.egg/matplotlib/backends/backend_tkagg.pyc in new_figure_manager_given_figure(num, figure) 87 """ 88 _focus = windowing.FocusManager() ---> 89 window = Tk.Tk() 90 window.withdraw() 91 /home4/sage/local/lib/python2.7/lib-tk/Tkinter.pyc in __init__(self, screenName, baseName, className, useTk, sync, use) 1743 baseName = baseName + ext 1744 interactive = 0 -> 1745 self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) 1746 if useTk: 1747 self._loadtk() TclError: no display name and no $DISPLAY environment variable



Thanks
Marc

ilan diamond

unread,
Apr 12, 2016, 10:11:41 AM4/12/16
to sage-support
HI Jason
I have gone through the stages of this sagecell installation. 
I run ubuntu 14.04
seems like the installation went fine.
But when i run  ../sage/sage web_server.py
I get the following errors (and the server does not start ) 

PowmInsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
  _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
Traceback (most recent call last):
  File "web_server.py", line 132, in <module>
    application = SageCellServer(baseurl = args.baseurl)
  File "web_server.py", line 57, in __init__
    max_kernel_timeout=max_kernel_timeout, tmp_dir = tmp_dir)
  File "/var/www/html/sc_build/sagecell/trusted_kernel_manager.py", line 40, in __init__
    comp_id = self.add_computer(comp)
  File "/var/www/html/sc_build/sagecell/trusted_kernel_manager.py", line 125, in add_computer
    client = self._setup_ssh_connection(cfg["host"], cfg["username"])
  File "/var/www/html/sc_build/sagecell/trusted_kernel_manager.py", line 84, in _setup_ssh_connection
    ssh_client.connect(host, username=username)
  File "/var/www/html/sc_build/sage/local/lib/python2.7/site-packages/paramiko/client.py", line 367, in connect
    look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host)
  File "/var/www/html/sc_build/sage/local/lib/python2.7/site-packages/paramiko/client.py", line 584, in _auth
    raise saved_exception
paramiko.ssh_exception.PasswordRequiredException: Private key file is encrypted

Can you tell me what went wrong ? 
Thank you :) 
Ilan Diamond
Reply all
Reply to author
Forward
0 new messages