17th Lvl Botanist
17th Lvl Botanist

Reputation: 155

How to I point to a local copy of Python on a Linux Server?

I have downloaded and compiled Python 2.7.12 into my $HOME directory on a Linux server.

Presently, I am having trouble setting that version of python into my local path and to be the default version even though I have now added a reference in my .bash_profile. See attached.

When I

 which python

I see that I am directed to the default 2.6 installation in /usr/bin/python.

Any ideas what I am doing wrong? Do you need more information?

Thanks in advance!

enter image description here

Upvotes: 0

Views: 313

Answers (1)

Niema Moshiri
Niema Moshiri

Reputation: 937

When you do PATH=$PATH:$HOME/bin, you're adding $HOME/bin to the end of your PATH variable (so it's the last place that is checked). If you want this python to be the priority, you need to add it to the beginning of your PATH:

PATH=$HOME/bin:$PATH

Upvotes: 2

Related Questions