LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   where is default python set? (https://www.linuxquestions.org/questions/slackware-14/where-is-default-python-set-862640/)

splintercdo 02-14-2011 12:53 PM

where is default python set?
 
Hey guys,

I guess this will be easy one.

I had 2.6.4 python from standard Slackware installation, I compiled source and installed python 2.5.5, made this with make install, not make altinstall, so 2.5.5 now is my default python and actually it's not a problem, but I started to wonder where is set some value that determines, that writing python in bash I start version 2.5.5 not 2.6.4?

I tried set and looked in /etc/profile, but there are no signs of things I find :S

bgeddy 02-14-2011 01:11 PM

Typing "python" into bash will run the first thing it finds in the path which is /usr/bin/python which is a link set to /usr/bin/python2.6 in standard Slackware. I'd be very careful when changing python versions from the distribution's default as you can run into all sorts of problems. Best to keep the original and install any different versions as additional and keep the python link pointing to the original too.

splintercdo 02-14-2011 01:17 PM

thanks, I forgot to tell I started to mess with symlinks, but for some reason
executing
rm /usr/bin/python
and then
ln -s /usr/bin/python2.6 /usr/bin/python
doesn't affect anything, almost... if I call /usr/bin/python then 2.6.4 is called, but if I write just python, then 2.5.5 is called hmm...

bgeddy 02-14-2011 01:19 PM

Try running this
Code:

file $(which python)
to see what's what and this
Code:

alias
to check you haven't set up an alias for python.

splintercdo 02-14-2011 01:27 PM

yes, thats good advice :) but a bit too late,
I found what was the problem, I looked again in /etc/profile and noticed that in my path variable /usr/local/bin was before /usr/bin

removed symlink from it: rm /usr/local/bin/python
and added 2.6.4 to it ln -s /usr/bin/python2.6 /usr/local/bin/python

everything is back to standard :)

thanks for help ;)


All times are GMT -5. The time now is 01:09 AM.