Automatically adjust PYTHONPATH for locally installed Python version.
authorW. Trevor King <wking@drexel.edu>
Thu, 17 Jun 2010 19:18:03 +0000 (15:18 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 17 Jun 2010 19:18:03 +0000 (15:18 -0400)
_bashrc

diff --git a/_bashrc b/_bashrc
index 35ebae283514eae954832b311e51f344f20dd1c7..ffc398d3ce75e1224f76abba1a30bb49ca31702c 100644 (file)
--- a/_bashrc
+++ b/_bashrc
@@ -14,7 +14,8 @@ export LD_LIBRARY_PATH=~/lib
 export TEXINPUTS=":.:$HOME/projects/latex/common/"
 
 # personalize python path
-export PYTHONPATH=".:$HOME/lib/python:$HOME/lib/python2.5/site-packages:$HOME/.python"
+PYTHON_VERSION=$(python -c 'import sys; print ".".join([str(i) for i in sys.version_info[:2]])')
+export PYTHONPATH=".:$HOME/lib/python:$HOME/lib/python$PYTHON_VERSION/site-packages:$HOME/.python"
 
 # append personal manpages to manpath
 export MANPATH=":$HOME/share/man"