First time here? Check out the FAQ!

Ask Your Question
2

How do I get sage to honor my PYTHONPATH environmental variable?

asked 14 years ago

bobby_mendoza gravatar image

I have a number of modules that I have in my documents folder but sage does not look like it honors my PYTHONPATH environmental variable. What do I have to add to my .bashrc or .bash_profile to have sage look at alternate paths?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 14 years ago

DSM gravatar image

updated 14 years ago

Sage uses PYTHONPATH for its own purposes. If you add the directory/directories to SAGE_PATH (export SAGE_PATH=/some/dir/here) it should work, at least it seems to for me.

Beware: it looks like SAGE_PATH is added before Sage's existing python in sage-env:

PYTHONPATH="$SAGE_PATH:$SAGE_ROOT/local/lib/python"   && export PYTHONPATH

so if you shadow one of the built-in modules you could get strange errors. [Not that you couldn't get errors if it were the other way 'round, of course, but you might not even be able to get to the prompt.]

Preview: (hide)
link

Comments

I'm also interested in this, but unfortunately I don't understand much of what is here written. Is it possible to explain this again for a computer newbie? (I'm trying to do this with ubuntu)

EmersonL gravatar imageEmersonL ( 13 years ago )

Emerson, these are directives specified in the .bashrc or .bash_profile file sitting in your home directory. The best thing for you to do is to learn about the .bashrc file (and the .bash_profile file) in general, then look into what are known as environment variables, which are these PATH things they are talking about.

tdstephens3 gravatar imagetdstephens3 ( 13 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 14 years ago

Seen: 2,042 times

Last updated: Oct 05 '11