I don't have much experience with tcsh, but I am interested in learning. I've been having issues getting Python to see PYTHONPATH
. I can echo $PYTHONPATH
, and it is correct, but when I start up Python, my paths do not show up in sys.path
. Any ideas?
EDIT:
[dmcdonal@tg-steele ~]$ echo $PYTHONPATH
/home/ba01/u116/dmcdonal/PyCogent-v1.1
>>> from sys import path
>>> from os import environ
>>> path
['', '/apps/steele/Python-2.5.2/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg', '/apps/steele/Python-2.5.2/lib/python2.5/site-packages/FiPy-2.0-py2.5.egg', '/apps/steele/Python-2.5.2', '/apps/steele/Python-2.5.2/lib/python25.zip', '/apps/steele/Python-2.5.2/lib/python2.5', '/apps/steele/Python-2.5.2/lib/python2.5/plat-linux2', '/apps/steele/Python-2.5.2/lib/python2.5/lib-tk', '/apps/steele/Python-2.5.2/lib/python2.5/lib-dynload', '/apps/steele/Python-2.5.2/lib/python2.5/site-packages', '/apps/steele/Python-2.5.2/lib/python2.5/site-packages/Numeric']
>>> environ['PYTHONPATH']
'/apps/steele/Python-2.5.2'
How are you setting PYTHONPATH? You might be confusing tcsh's set vs. setenv. Use "set" to set what tcsh calls shell variables and use "setenv" to set environment variables. So, you need to use setenv in order for Python to see it. For example:
$ set FOO='bar'
$ echo $FOO
bar
$ python -c 'import os; print os.getenv("FOO")'
None
$ setenv BAR 'wiz'
$ echo $BAR
wiz
$ python -c 'import os; print os.getenv("BAR")'
wiz
There is some more information available in the variables section of the tcsh documentation.