faqts : Computers : Programming : Languages : Python : Installation and Configuration

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

19 of 28 people (68%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How can I set-up the variable $PYTHONHOME?

May 24th, 2000 06:17
unknown unknown, Frank Mattes


This is typically done in your shell resource file, in your home dir.
If you happen to have Beazley's Essential Reference (which is a good
idea), see pg 84.

For csh or tcsh, edit ".cshrc":
setenv PYTHONHOME /opt/python

For bash edit ".bashrc"; for ksh edit ".kshrc":
export PYTHONHOME=/opt/python


In both cases, PYTHONHOME can point to the general python home (as 
above) or to both the general home and the exec home, by doing a path
concatenation, e.g.:

export PYTHONHOME=/opt/python:/usr/local/my_special_python

You will have to "source" the "rc" file before it will take effect -- 
the easiest way may be to just log out and log back in.