I am on a shared host and can not change the symbolic link to Python2.4, it defaults to 2.3. I tried creating a sym link in the director I would be working on to 2.4, but it seems the the 'global' python interpreter under /usr/bin/python take presedence unless I run it as ./python. What alternative ways are there to override this behaviour?
+3
A:
Create a symlink and prepend the path to your PATH variable:
ln -s /usr/bin/python2.4 $HOME/bin/python
export PATH="$HOME/bin:$PATH"
Bombe
2008-12-09 15:37:31
Many thanks. This worked!
Ravi Chhabra
2008-12-09 16:14:27
+4
A:
If you're working from the shell, you can create a symbolic link as suggested and update your path in the .profile. This is described in a previous post.
In case these are CGI/whatever scripts that you only run on your shared host, you can alter the shebang line at the top of your scripts that tell the system what interpreter to run the script with.
I.e. change
#!/usr/bin/env python
to
#!/whatever/the/path/to/your/version/python
Hehe... I was just about to post the exact same solution. You was 5 sec faster than me. :-)
Eigir
2008-12-09 15:49:59