0

Possible Duplicate:
How to make exported shell variables permanent?

Each time I set the $PYTHONPATH on my new Ubuntu server machine (old Thinkpad) and reboot, it's reset to blank.

I'm setting it like this:

export PYTHONPATH=/usr/lib/python2.7

If I ask it after that to echo $PYTHONPATH it will. And it finds modules on the path. But it loses it when I reboot. Any ideas why?

2 Answers2

2

Add the assignment to /etc/environment, that's what this file is designed for.

Chris Down
  • 125,559
  • 25
  • 270
  • 266
0

Add the export command to your ~/.profile file. It will get executed every time you login. To set the value on a system wide basis, you can add it to /etc/environment.

Assuming you are using python 2.7, /usr/lib/python2.7 should be built-in. You shouldn't need to define PYTHONPATH to access modules located there. To see if it is already included try this before you set PYTHONPATH. Run python and enter these commands:

import sys
sys.path
BillThor
  • 8,965