1

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?

2 Answers 2

3

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
Sign up to request clarification or add additional context in comments.

1 Comment

Hehe... I was just about to post the exact same solution. You was 5 sec faster than me. :-)
2

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"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.