Re: [sage-support] Re: sage 5.0 rc0 notebook() not working!

2012-05-08 Thread Kjetil brinchmann Halvorsen
Thanks. See inline below.

On Tue, May 8, 2012 at 2:36 AM, Keshav Kini  wrote:
> Kjetil brinchmann Halvorsen  writes:
>> I will try, but since I have not done this sort of things with sage before,
>> ¿How to do it? It is as simple as drop-in repacing one (or a few files) All 
>> the
>> files have the same name(s) as corresonding old files, so now change to the
>> Makefile is necessary?
>
> Well, if you go to the ticket page I linked, you will see there is a
> list of commands you can paste into a terminal to do all the setup for
> you. Basically it amounts to applying a bunch of patches to Sage and
> installing a couple of SPKGs.
>
> (If you are not yet aware of it, larger parts of Sage such as bundled
> applications, or for example the notebook, are distributed as .spkg
> files, which are basically a tarball with an installer script inside.
> See the Sage developers' guide for more info - it's in the docs.)

I wnnt to the trac tickets page you referenced, and applied all the
patches as shown there.
But it does'nt seem to solve the problem!

Here is what happens (again, inside emacs)


kjetil@kjetil:~/sage/sage-5.0.rc0$ ./sage
--
| Sage Version 5.0.rc0, Release Date: 2012-05-01 |
| Type notebook() for the GUI, and license() for information.|
--
**
**
* Warning: this is a prerelease version, and it may be unstable. *
**
**



sage: sage: sage: sage: notebook()
The notebook files are stored in: sage_notebook.sagenb
Upgrading model version to version 1
Done upgrading to model version 1
---
RuntimeError  Traceback (most recent call last)

/home/kjetil/.sage/ in ()

/home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/notebook/notebook_object.py
in __call__(self, *args, **kwds)
204 """
205 def __call__(self, *args, **kwds):
--> 206 return self.notebook(*args, **kwds)
207
208 notebook = run_notebook.notebook_twisted

/home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/notebook/run_notebook.py
in notebook_twisted(self, directory, port, interface, address,
port_tries, secure, reset, require_login, accounts, openid,
server_pool, ulimit, timeout, open_viewer, sagetex_path, start_path,
fork, quiet, subnets)
429 print "*" * 70
430
--> 431 port = find_next_available_port(interface, port, port_tries)
432 if open_viewer:
433 "Open viewer automatically isn't fully implemented.
You have to manually open your web browser to the above URL."

/home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/misc/misc.py in
find_next_available_port(interface, start, max_tries, verbose)
132 print "Port %s is already in use."%port
133 print "Trying next port..."
--> 134 raise RuntimeError, "no available port."
135
136

RuntimeError: no available port.
sage:

(from a terminal emulator, the same thing happens)

Kjetil


>
> -Keshav
>
> 
> Join us in #sagemath on irc.freenode.net !
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org



-- 
"If you want a picture of the future - imagine a boot stamping on the
human face - forever."

George Orwell (1984)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0 notebook() not working!

2012-05-07 Thread Kjetil brinchmann Halvorsen
see inline.

On Mon, May 7, 2012 at 1:17 PM, Keshav Kini  wrote:

> Kjetil brinchmann Halvorsen  writes:
> > That is, the same problem. Kjetil
>
> Hmm. Well, I know this is a sort of asking a lot of you, but would you
> try using the rewritten notebook version at trac ticket #11080 (
> http://trac.sagemath.org/sage_trac/ticket/11080 ) and see if that works?
> Hopefully it will go into Sage soon - we're thinking in 5.1 - and we are
>

I will try, but since I have not done this sort of things with sage before,
¿How to do it? It is as simple as drop-in repacing one (or a few files) All
the files have the same name(s) as corresonding old files, so now change to
the Makefile is necessary?

Kjetil


> no longer maintaining the old notebook code (and haven't for about a
> year and a half (!) now).
>
> Of course, if we find a bug in the old notebook code we can always try
> to port it to the new notebook, but in many cases that bug might not
> even exist in the new notebook, so if installing the new notebook makes
> your problem go away then that would be the best outcome...
>
> -Keshav
>
> 
> Join us in #sagemath on irc.freenode.net !
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
"If you want a picture of the future - imagine a boot stamping on the human
face - forever."

George Orwell (1984)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0 notebook() not working!

2012-05-07 Thread Kjetil brinchmann Halvorsen
see inline.

On Mon, May 7, 2012 at 10:41 AM, Keshav Kini  wrote:

> Kjetil brinchmann Halvorsen  writes:
> > Notebook() is not working: (I am calling this from within a shell in
> emacs)
>
> And if you try it from, say, bash? I note that the code gives up trying
> to find ports if it receives 10 or more keyboard interrupts - perhaps
> something about the input stream from Emacs is confusing it?
>

Trying from a terminal emulator:

sage: notebook()
The notebook files are stored in: sage_notebook.sagenb
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (114, 0))

---
RuntimeError  Traceback (most recent call last)

/home/kjetil/.sage/ in ()

/home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/notebook/notebook_object.pyc
in __call__(self, *args, **kwds)
215 """
216 def __call__(self, *args, **kwds):
--> 217 return self.notebook(*args, **kwds)
218
219 notebook = run_notebook.notebook_twisted

/home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/notebook/run_notebook.pyc
in notebook_twisted(self, directory, port, interface, address, port_tries,
secure, reset, accounts, require_login, server_pool, ulimit, timeout,
open_viewer, sagetex_path, start_path, fork, quiet, subnets)
441 print "*" * 70
442
--> 443 port = find_next_available_port(interface, port, port_tries)
444 if open_viewer:
445 "Open viewer automatically isn't fully implemented.  You
have to manually open your web browser to the above URL."

/home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/misc/misc.pyc in
find_next_available_port(interface, start, max_tries, verbose)
132 print "Port %s is already in use."%port
133 print "Trying next port..."
--> 134 raise RuntimeError, "no available port."
135
136

RuntimeError: no available port.
sage:

That is, the same problem. Kjetil



>
> -Keshav
>
> 
> Join us in #sagemath on irc.freenode.net !
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
"If you want a picture of the future - imagine a boot stamping on the human
face - forever."

George Orwell (1984)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0

2012-05-07 Thread Keshav Kini
On Mon, May 7, 2012 at 1:01 PM, Johan Grönqvist
 wrote:
> This also works for local
> networking, it does not matter if the request to port 80 came from the
> outside or from another program running on the same machine.

Well, this is not strictly true. It is only true if the server is
listening on port 80 on interface 0.0.0.0. If it is listening on
interface 127.0.0.1 then it will only accept local connections; if it
is listening on any other interface x.y.z.w then it will only accept
connections addressed to recipient "x.y.z.w".

-Keshav


Join us in #sagemath on irc.freenode.net !

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0

2012-05-07 Thread Kjetil brinchmann Halvorsen
see below.

On Mon, May 7, 2012 at 1:01 AM, Johan Grönqvist
wrote:

> 2012-05-07 04:16, Kjetil brinchmann Halvorsen skrev:
>
>
>>Do you use anything that may affect sage's ability to open ports?
>>
>>
>>   My problem with answering is that I don't really know anything about
>> "ports" . I guess that has something to do with networking,
>> but nbothing more! Any hints about books/papers/netplaces to read to
>> learn about "ports"?
>>
>>
> This problem is probably beyond me, but someone else might answer, and you
> have the other thread going on the same problem. I do not expect that the
> text below will solve your problem, but perhaps it helps you understand the
> error message better:
>
>
> My (possibly incorrect) intuition about ports:
>
> We have networking and we need a way to organize the programs that want to
> connect to the network. Let's imagine that the network card has 2^16
> different "connection points" that the programs can connect to, and let's
> call them ports. When a program connects to another (on the same or a
> different machine), it needs to communicate with a port, and the responding
> program needs to "listen" to that port. As an example, my web server
> listens to incoming requests from others, and it does so on port 80. Thus
> if you want to see on of the web pages it serves, you send a request to
> that computer, and send it to port 80 on that computer. This also works for
> local networking, it does not matter if the request to port 80 came from
> the outside or from another program running on the same machine.
>
> The sage notebook runs in a web server, and you connect to it locally (or
> remotely if the notebook is configured to respond to requests from other
> machines, which it is probably not, for security purposes.
>
> You can see some info about open ports by running "netstat -t -p". My sage
> notebook runs on port 8000.
>

Here is my output from sudo netstat -t -p

kjetil@kjetil:~$ sudo netstat -t -p
[sudo] password for kjetil:
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address   Foreign Address
State   PID/Program name
tcp0  0 kjetil:38929mia04s04-in-f9.1e:https
ESTABLISHED 4994/firefox-bin
tcp0  0 kjetil:38531ec2-75-101-130-133:http
TIME_WAIT   -
tcp0  0 kjetil:36936mia05s08-in-f11.1:https
ESTABLISHED 4994/firefox-bin
tcp0  0 kjetil:45665mia04s04-in-f3.1e:https
TIME_WAIT   -
tcp0  0 kjetil:53141yh-in-f105.1e100.:https
ESTABLISHED 4994/firefox-bin
tcp0  0 kjetil:35941mia04s04-in-f21.1:https
ESTABLISHED 4994/firefox-bin
tcp0  0 kjetil:46639pc-178-224-45-190:https
ESTABLISHED 4881/skype
tcp0  0 kjetil:48800mia04s04-in-f5.1e:https
TIME_WAIT   -
tcp0  0 kjetil:38928mia04s04-in-f9.1e:https
ESTABLISHED 4994/firefox-bin
tcp0  0 kjetil:53132yh-in-f105.1e100.:https
TIME_WAIT   -
tcp0  0 kjetil:57393157.55.235.148:https
ESTABLISHED 4881/skype
tcp0  0 kjetil:38530ec2-75-101-130-133:http
TIME_WAIT   -
tcp0  0 kjetil:44755pc-78-210-83-200.:https
ESTABLISHED 4881/skype
tcp0  0 kjetil:52682TGV.ANYCAST-FO.CHI:http
ESTABLISHED 4994/firefox-bin
tcp0  0 kjetil:45666mia04s04-in-f3.1e:https
TIME_WAIT   -
tcp0  0 kjetil:35912mia04s04-in-f21.1:https
ESTABLISHED 4994/firefox-bin
kjetil@kjetil:~$


Kjetil




>
>
> One example output line of the netstat command is
>
> tcp 0 0 johan-laptop.loca:3 87.117.201.130:ircd ESTABLISHED
> 28025/xchat-gnome
>
> Saying that I have a tcp port open (there are two kinds, tcp and udp and
> sage uses tcp), from my local machine, port 3 to 87.117.201.130 port
> ircd (I assume this indicated the standard port for an irc client) and the
> port was opened by the program xchat-gnome.
>
> The wikipedia page is at  Port_%28computer_networking%29
> **>
>
>
>
>  kjetil@kjetil:~/sage/sage-5.0.**rc0$ ./sage --ipython
>> WARNING: Configuration file ipythonrc not found. Ignoring request.
>> --**--
>> Traceback (most recent call last):
>>   File
>> "/home/kjetil/sage/sage-5.0.**rc0/local/lib/python2.7/site-**
>> packages/IPython/ConfigLoader.**py",
>> line 66, in load
>> fname = filefind(fname,incpath)
>>   File
>> "/home/kjetil/sage/sage-5.0.**rc0/local/lib/python2.7/site-**
>> packages/IPython/genutils.py",
>> line 554, in filefind
>> ' not found in current or supplied directories:' + `alt_dirs`
>> IOError: File'ipythonrc' not found in current or supplied
>> directories:u'/home/kjetil/.**ipython'
>>
>> WARNING: Problems loading configuration file 'ipythonrc'
>> Starting with default -bare bon

Re: [sage-support] Re: sage 5.0 rc0 notebook() not working!

2012-05-07 Thread P Purkayastha


On Monday, May 7, 2012 10:20:49 AM UTC+8, kjetil1001 wrote:
>
> inline:
>
> On Sun, May 6, 2012 at 10:10 PM, P Purkayastha  wrote:
>
>> Do you have some kind of firewall running? The error seems strange:
>> RuntimeError: no available port.
>>
>> Well, this is my private laptop. (used from the university' s network)
>
> I don know of any firewalls I have installed, and I can't imagine how any 
> firewall on the university' s
> network could affect sage running locally on my machine?
>
> Kjetil
>

Do you have iptables and/or shorewall configured and running on your 
laptop?  That is one program that could be preventing sage from opening 
ports. If it is none of the above, then I don't know how to help you.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0

2012-05-07 Thread Keshav Kini
On Mon, May 7, 2012 at 1:01 PM, Johan Grönqvist
 wrote:
> As all tests pass for my wheezy, let me know if there is anything I can do
> to see where we differ. I do have ipython 0.12 (which is 0.11 or newer, and
> I do not get the error.

Hmm. I can't reproduce it on wheezy either.

-Keshav


Join us in #sagemath on irc.freenode.net !

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0 notebook() not working!

2012-05-06 Thread Kjetil brinchmann Halvorsen
inline:

On Sun, May 6, 2012 at 10:10 PM, P Purkayastha  wrote:

> Do you have some kind of firewall running? The error seems strange:
> RuntimeError: no available port.
>
> Well, this is my private laptop. (used from the university' s network)

I don know of any firewalls I have installed, and I can't imagine how any
firewall on the university' s
network could affect sage running locally on my machine?

Kjetil






> On Sunday, May 6, 2012 3:12:39 AM UTC+8, kjetil1001 wrote:
>>
>> This is debian wheezy, amd64.
>>
>> Notebook() is not working: (I am calling this from within a shell in
>> emacs)
>>
>> notebook()
>> sage: sage: sage: sage: sage: sage: sage: sage: The notebook files are
>> stored in: sage_notebook.sagenb
>> ERROR: An unexpected error occurred while tokenizing input
>> The following traceback may be corrupted or invalid
>> The error message is: ('EOF in multi-line statement', (114, 0))
>>
>>
>> ---
>> RuntimeError  Traceback (most recent call
>> last)
>>
>> /home/kjetil/.sage/ in ()
>>
>> /home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/notebook/notebook_object.pyc
>> in __call__(self, *args, **kwds)
>> 215 """
>> 216 def __call__(self, *args, **kwds):
>> --> 217 return self.notebook(*args, **kwds)
>> 218
>> 219 notebook = run_notebook.notebook_twisted
>>
>> /home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/notebook/run_notebook.pyc
>> in notebook_twisted(self, directory, port, interface, address, port_tries,
>> secure, reset, accounts, require_login, server_pool, ulimit, timeout,
>> open_viewer, sagetex_path, start_path, fork, quiet, subnets)
>> 441 print "*" * 70
>> 442
>> --> 443 port = find_next_available_port(interface, port, port_tries)
>> 444 if open_viewer:
>> 445 "Open viewer automatically isn't fully implemented.  You
>> have to manually open your web browser to the above URL."
>>
>> /home/kjetil/sage/sage-5.0.rc0/devel/sagenb/sagenb/misc/misc.pyc in
>> find_next_available_port(interface, start, max_tries, verbose)
>> 132 print "Port %s is already in use."%port
>> 133 print "Trying next port..."
>> --> 134 raise RuntimeError, "no available port."
>> 135
>> 136
>>
>> RuntimeError: no available port.
>> sage:
>>
>>
>> Kjetil
>>
>>
>>
>> --
>> "If you want a picture of the future - imagine a boot stamping on the
>> human face - fo
>>
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: sage 5.0 rc0

2012-05-06 Thread Kjetil brinchmann Halvorsen
see inline.

On Sun, May 6, 2012 at 1:20 AM, Johan Grönqvist
wrote:

> I hope others try to answer as well, as I probably do not know enough to
> help you solve it.
>
> 2012-05-05 21:37, Kjetil brinchmann Halvorsen skrev:
>
>File
>> "/home/kjetil/sage/sage-5.0.**rc0/devel/sagenb/sagenb/misc/**misc.py",
>> line
>> 134, in find_next_available_port
>> raise RuntimeError, "no available port."
>> RuntimeError: no available port.
>> 
>> **
>>
>
> From looking at the file:
>
> Sage loops through all ports in some interval, looking for one it can use,
> but does not find any. This is also the reason you fail to start the
> notebook, I would guess.
>
> Do you use anything that may affect sage's ability to open ports?


  My problem with answering is that I don't really know anything about
"ports" . I guess that has something to do with networking,
but nbothing more! Any hints about books/papers/netplaces to read to learn
about "ports"?


>
>
>  sage -t  -force_lib "devel/sage/sage/tests/**cmdline.py"
>> 
>> **
>> File "/home/kjetil/sage/sage-5.0.**rc0/devel/sage/sage/tests/**
>> cmdline.py",
>> line 314:
>> sage: err
>> Expected:
>> ''
>> Got:
>> 'WARNING: Configuration file ipythonrc not found. Ignoring request.
>>
>
>
> Here, the test tries to start "./sage --ipython" and ask it to compute
> "3**33", but it warns about a configuration file missing. If you run
> "./sage --ipython", do you get a nice prompt where you can type 3**33?
>
> OK, this is what is happening:  (again, whitin an emacs shell)

kjetil@kjetil:~/sage/sage-5.0.rc0$ ./sage --ipython
WARNING: Configuration file ipythonrc not found. Ignoring request.

Traceback (most recent call last):
  File
"/home/kjetil/sage/sage-5.0.rc0/local/lib/python2.7/site-packages/IPython/ConfigLoader.py",
line 66, in load
fname = filefind(fname,incpath)
  File
"/home/kjetil/sage/sage-5.0.rc0/local/lib/python2.7/site-packages/IPython/genutils.py",
line 554, in filefind
' not found in current or supplied directories:' + `alt_dirs`
IOError: File'ipythonrc' not found in current or supplied
directories:u'/home/kjetil/.ipython'

WARNING: Problems loading configuration file 'ipythonrc'
Starting with default -bare bones- configuration.
---
ImportError   Traceback (most recent call last)

/home/kjetil/sage/sage-5.0.rc0/local/lib/python2.7/site-packages/IPython/ipmaker.pyc
in force_import(modname, force_reload)
 61 reload(sys.modules[modname])
 62 else:
---> 63 __import__(modname)
 64
 65

ImportError: Bad magic number in /home/kjetil/.ipython/ipy_user_conf.pyc
WARNING: /home/kjetil/.ipython/ipy_user_conf.py does not exist, please run
%upgrade!
WARNING: Loading of ipy_user_conf failed.

Python 2.7.2 (default, May  3 2012, 22:40:27)
Type "copyright", "credits" or "license" for more information.

IPython 0.10.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: 3**33

Out[1]: 555906056623

In [2]:

Kjetil






> On my wheezy:
>
>
> --**--
> johan@johan-laptop:~/**Applications/sage-5.0.rc0$ ./sage --ipython
> Python 2.7.2 (default, May  2 2012, 23:01:21)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.10.2 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help  -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints more.
>
> In [1]: 3**33
> Out[1]: 555906056623
>
> In [2]:
> --**-
>
>
>
>  On Fri, May 4, 2012 at 8:35 PM, Kjetil brinchmann Halvorsen
>> mailto:kjetil1...@gmail.com>> wrote:
>>
>>I downloaded the rc0 for sage 5.0, compiled without problems, and
>>then run make test
>>
>>This was reported:
>>
>>The following tests failed:
>>
>>
>> sage -t  -force_lib "devel/sagenb-main/sagenb/**misc/misc.py"
>> sage -t  -force_lib "devel/sage/sage/tests/**cmdline.py"
>>Total time for all tests: 12211.8 seconds
>>make: *** [test] Error 128
>>
>>--**--**
>> --**
>>This is debian wheezy amd64, with
>>~/sage/sage-5.0.rc0 $ gcc --version
>>gcc (Debian 4.6.3-1) 4.6.3
>>Copyright (C) 2011 Free Software Foundation, Inc.
>>This is free software; see the source for copying conditions.  There
>>is NO
>>warranty; not even for MERCHAN