%cython failing in notebook because of accessing the wrong directory

48 views
Skip to first unread message

Maarten Derickx

unread,
Mar 28, 2012, 5:19:55 PM3/28/12
to sage-s...@googlegroups.com
Dear All,

I've setup my own sage server (running sage 4.8 on debian) with two accounts. One called "sagerunner" wich actually runs the notebook and one called sageslave wich runs the calculations. To be more precise notebook is started with the argument server_pool=["sageslave@localhost"]. But when I try to use %cython in a cell I get:

Traceback (click to the left of this block for traceback)
...
IOError: [Errno 13] Permission denied:
'/home/sagerunner/.sage/sage_notebook.sagenb/home/maarten/9/code/sage5.s\
pyx'
 
Wich is because the user sageslave doesn't have acces to that place (and he indeed should not need to acces that place since it might even be on a different host!). I was wondering, is this a problem with my setup or a genuine notebook bug?

Maarten Derickx

unread,
Mar 28, 2012, 5:23:48 PM3/28/12
to sage-s...@googlegroups.com
B.T.W. I published a worksheet wich show the problems

Marcin Kostur

unread,
Mar 31, 2012, 2:57:19 PM3/31/12
to sage-s...@googlegroups.com
Hi,

We actually run into the same problem. Sage process need $HOME for 2 cases - 1) cython compilation 2) access to DATA - e.g. uploaded by UI.
We simply mounted $HOME over a cluster....

the best

mk

Priyanka Kapoor

unread,
Apr 1, 2012, 1:57:40 AM4/1/12
to sage-s...@googlegroups.com
When I run code :
%cython
cdef hello():
print 'hello world!'
I got two files , one is html file and another is C file.
Html contents are:
1:

2: include "interrupt.pxi" # ctrl-c interrupt block support

3: include "stdsage.pxi" # ctrl-c interrupt block support

4:

5: include "cdefs.pxi"

6: cdef hello():

7: print 'hello world!'

I am new to sage. I dont know much about it. Can you clarify now?
Whats the problem in actual?
I also wish to know what is the problem and how the desired output
hello world will come.


--
Priyanka Kapoor
http://kapoorpriyanka.in
Linux User Group, Ludhiana

Maarten Derickx

unread,
Apr 2, 2012, 4:01:12 PM4/2/12
to sage-s...@googlegroups.com
In your setup everything worked ok. You just defined a function called hello. The function was never executed so you didn't see anything.
To execute the function try the following:

hello()

Considdering you are new with sage I suggest first learn how to use python (and don't use the %cython). Only after you are familiar with that it might be good to start learning cython.  And then would only need it if you wrote some code that calls some fast functions in a smal for loop that is annoyingly slow.

Priyanka Kapoor

unread,
Apr 3, 2012, 9:43:39 AM4/3/12
to sage-s...@googlegroups.com
On Tue, Apr 3, 2012 at 1:31 AM, Maarten Derickx
<m.derick...@gmail.com> wrote:
> In your setup everything worked ok. You just defined a function called
> hello. The function was never executed so you didn't see anything.
> To execute the function try the following:
>
> hello()

Ok

> Considdering you are new with sage I suggest first learn how to use python
> (and don't use the %cython). Only after you are familiar with that it might
> be good to start learning cython.  And then would only need it if you wrote
> some code that calls some fast functions in a smal for loop that is
> annoyingly slow.
>

Thanks for guidance. I will definately follow. :-)

Reply all
Reply to author
Forward
0 new messages