Results 1 to 10 of 13
hi, i'm trying to update python on my centos distro, by typing:
yum update python
but yum says there are no packages that require updating, though my python version is ...
- 09-29-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 12
Updating python on centos
hi, i'm trying to update python on my centos distro, by typing:
yum update python
but yum says there are no packages that require updating, though my python version is 2.3
how do i upgrade to the latest version?
- 09-30-2007 #2
I wouldn't mess around with Python unless you are good at troubleshooting. Some of the package management tools require python, so if python breaks, you can be stuck without tools such as yum. If you need a newer version of python, you can compile it from source into a different prefix. CentOS is very conservative about package versions because it meant to be a stable platform, so there are only bug fixes and no new features during the lifetime of a release.
- 10-02-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 12
Can you explain to me how do i do that?
Wouldn't it be easier installing python2.5 using yum, but like you said not making it the default python interpreter to use?
Thanks
- 10-03-2007 #4
If you are building python from source, to install it into another prefix, you would do something like
I usually use /usr/local/python as the installation directory. As for using yum in the manner you suggested, its possible but unfortunately most rpms are built to overwrite older versions, so the default intepreter would be the latest version because the old one will have been overwritten.Code:#./configure --prefix=/path/to/some/prefix
- 10-03-2007 #5Just Joined!
- Join Date
- Sep 2007
- Posts
- 12
sorry, that was too generic for me... can you give me a real example?
- 10-03-2007 #6
- 10-03-2007 #7Just Joined!
- Join Date
- Sep 2007
- Posts
- 12
Ok, thanks, i now understand your last post completely.
One last (stupid) question - how do i run the new python interpreter installed? typing "python' of course runs the old preinstalled 2.3 interpreter. and when i look at the bin directory under the install path there's a file named python2.5 but typing it's name causes an "illegal command" error... any ideas?
- 10-03-2007 #8
You can use the full path name e.g. /usr/local/python/python.
- 10-03-2007 #9Just Joined!
- Join Date
- Sep 2007
- Posts
- 12
1. just for general knowledge, since i don't get - when i'm in the dir /usr/local/python2.5/bin/ and i type "python2.5 " i get "bash: python2.5: command not found" but when i type the full path i.e. /usr/local/python2.5/bin/python2.5 it works fine.
2. how can i bind the keyword "python2.5" with the python2.5 interpreter, i.e that it'll work from any directory simply by typing "python2.5" and not the full path, like it works for the "python" (the 2.3 version)? do i have to add python2.5's path to PATH? As a programmer that sounds to me like bad practice, like not dividing your fnuctions and classes to namespaces in C++.
- 10-03-2007 #10
You can create a symlink e.g.
After issuing that command, you should be able to enter the command python2.5 without any command not found errors.Code:#ln -s /usr/local/python2.5/bin/python /usr/local/bin/python2.5



