Ask Your Question
0

notebook and init.sage

asked 2013-10-14 22:05:37 +0100

anonymous user

Anonymous

I recently upgraded from 5.9 to 5.12.

My init.sage file loads/attaches a .sage file that I often use. In 5.9, that file was still attached when I started up a worksheet in the notebook. In 5.12, it is attached in the terminal, but when I then start open a worksheet in the notebook, it seems to be no longer attached since none of my functions are known any more and give a NameError when tried.

What can I do to fix this?

edit retag flag offensive close merge delete

Comments

What is the exact syntax you used? This has recently changed (though I thought it was before 5.9) and conceivably affected things.

kcrisman gravatar imagekcrisman ( 2013-10-14 22:53:47 +0100 )edit

It looks to me as though this broke between Sage 5.10 (where it works) and 5.11 (where it doesn't). I think the problem was introduced in http://trac.sagemath.org/ticket/14523.

John Palmieri gravatar imageJohn Palmieri ( 2013-10-19 19:27:14 +0100 )edit
1

This bug has now been reported at http://trac.sagemath.org/ticket/15308.

John Palmieri gravatar imageJohn Palmieri ( 2013-10-19 19:29:41 +0100 )edit

I have a problem that may be related. I use load_attach_path followed by attach. I get the error "NameError: name 'var' is not defined" from within the attached file. I am using Ubuntu 12.04 x64 and using the Sage notebook. This worked in 5.10 and stopped working in 5.11.

BobB gravatar imageBobB ( 2013-10-20 00:12:16 +0100 )edit

I've also reported this upstream at https://github.com/sagemath/sagenb/issues/251

kcrisman gravatar imagekcrisman ( 2014-10-24 15:03:19 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-10-19 15:31:13 +0100

AndreWin gravatar image

Hello! The problem is in file

$SAGE_ROOT/spkg/bin/sage-env

There is line SAGE_STATUP_FILE = "$DOT_SAGE/init.sage"
I replaced this line to:
SAGE_STATUP_FILE = "home/andrei/.sage/init.sage"
I found the bug in such way:

>>import os
>>os.environ['SAGE_STARTUP_FILE']
/home/andrei/.sage//init.sage
edit flag offensive delete link more

Comments

First, what OS are you using? Second, what is the bug here? (Having multiple slashes in a row doesn't actually affect the path: `/home/andrei/.sage/init.sage` and `/home/andrei/.sage//init.sage` point to the same file.) Third, making your change doesn't seem to have any effect: the file will still be loaded from the command-line, and not from the notebook.

John Palmieri gravatar imageJohn Palmieri ( 2013-10-19 19:04:31 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-10-14 22:05:37 +0100

Seen: 646 times

Last updated: Oct 19 '13