Too many python installations. Should i remove them all and installthe latest?

  • Thread starter Íéêüëáïò Êïýñáò
  • Start date
Í

Íéêüëáïò Êïýñáò

I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i justtried:

Code:
root@nikos [~]# which python
/usr/bin/python
root@nikos [~]# which python3
/root/.local/lib/python2.7/bin/python3
root@nikos [~]# which python3.3
/root/.local/lib/python2.7/bin/python3.3
root@nikos [~]#

Why so many pythons in my system.
Now in the case of my Python3 installation, it looks like i have two parallel installations of Python3, but i don't. One is almost certainly a symlinkto the other and not an actual installation.

I'm thinking of:

yum remove python
yum remove python3
yum remove python3.3

and

yum install python3.3.2 from scratch.

I'm sceptic about uninstalling python 2.x though. Seems to me as a bad ideabecause most of the core system utilities are written in Python 2.6+. Yum,for example, is a collection of Python 2.6 programs. If i actually do "yumremove python" i will see most of my core system get listed in the uninstall dependency list -- which is a Bad Thing.

But then again i dont like the idea of having too many Python into my system.
What is you opinion?
 
F

Fábio Santos

I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just tried:

Code:
root@nikos [~]# which python
/usr/bin/python
root@nikos [~]# which python3
/root/.local/lib/python2.7/bin/python3
root@nikos [~]# which python3.3
/root/.local/lib/python2.7/bin/python3.3
root@nikos [~]#

Why so many pythons in my system.
Now in the case of my Python3 installation, it looks like i have two
parallel installations of Python3, but i don't. One is almost certainly a
symlink to the other and not an actual installation.
I'm thinking of:

yum remove python
yum remove python3
yum remove python3.3

and

yum install python3.3.2 from scratch.

I'm sceptic about uninstalling python 2.x though. Seems to me as a bad
idea because most of the core system utilities are written in Python 2.6+.
Yum, for example, is a collection of Python 2.6 programs. If i actually do
"yum remove python" i will see most of my core system get listed in the
uninstall dependency list -- which is a Bad Thing.
But then again i dont like the idea of having too many Python into my system.
What is you opinion?

Check if python3 and python3.3 aren't the same. Run them and look at the
"intro" lines.
 
Í

Íéêüëáïò Êïýñáò

Τη ΠαÏασκευή, 31 ΜαÎου 2013 6:37:06 μ.μ. UTC+3, ο χÏήστης Fábio Santos έγÏαψε:
Check if python3 and python3.3 aren't the same. Run them and look at the "intro" > lines.

root@nikos [~]# python -V
Python 2.6.6
root@nikos [~]# python3 -V
Python 3.3.0
root@nikos [~]# python3.3 -V
Python 3.3.0
root@nikos [~]# python3
Python 3.3.0 (default, Apr 6 2013, 01:53:31)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.root@nikos [~]# python3.3
Python 3.3.0 (default, Apr 6 2013, 01:53:31)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.root@nikos [~]#
 
M

Michael Torrie

Why so many pythons in my system. Now in the case of my Python3
installation, it looks like i have two parallel installations of
Python3, but i don't. One is almost certainly a symlink to the other
and not an actual installation.

Well is it a symlink?
I'm thinking of:

yum remove python
yum remove python3
yum remove python3.3

What a fantastic way to completely break your os! Python 2 is is a deep
dependency of CentOS. You cannot remove it. Python3 and 3.3 can be
removed of course.
 
I

Ian Kelly

Τη ΠαÏασκευή, 31 ΜαÎου 2013 6:37:06 μ.μ. UTC+3, ο χÏήστης Fábio Santos έγÏαψε:
Check if python3 and python3.3 aren't the same. Run them and look at the"intro" > lines.

root@nikos [~]# python -V
Python 2.6.6
root@nikos [~]# python3 -V
Python 3.3.0
root@nikos [~]# python3.3 -V
Python 3.3.0

So it looks like you have two Python installations, one for Python 2
and one for Python 3. Why is that too many?
 
Í

Íéêüëáïò Êïýñáò

Ôç ÐáñáóêåõÞ, 31 ÌáÀïõ 2013 6:55:03 ì.ì.. UTC+3, ï ÷ñÞóôçò Michael Torrie Ýãñáøå:
Well is it a symlink?








What a fantastic way to completely break your os! Python 2 is is a deep

dependency of CentOS. You cannot remove it. Python3 and 3.3 can be

removed of course.

root@nikos [~]# ls -al /usr/bin/python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python*
lrwxrwxrwx 1 root root 6 Apr 5 20:34 /usr/bin/python2 -> python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6*
-rwxr-xr-x 1 root root 1418 Feb 22 02:00 /usr/bin/python2.6-config*
lrwxrwxrwx 1 root root 24 Apr 7 22:10 /usr/bin/python3 -> /opt/python3/bin/python3*
lrwxrwxrwx 1 root root 16 Apr 5 20:35 /usr/bin/python-config -> python2.6-config*
root@nikos [~]#

so, i should just 'yum remove python3' ?
root@nikos [~]# python3 -V
Python 3.3.0
root@nikos [~]# python3.3 -V
Python 3.3.0

whre is that 3.3 anyway that which presents?
 
Í

Íéêüëáïò Êïýñáò

root@nikos [~]# yum remove python3
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: python3
Loading mirror speeds from cached hostfile
* base: ftp.plusline.de
* extras: ftp.plusline.de
* updates: ftp.plusline.de
base | 3.7 kB 00:00
extras | 3.5 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.6 MB 00:00
vz-base | 951 B 00:00
vz-updates | 951 B 00:00
No Packages marked for removal
root@nikos [~]# yum remove python3.3
Loaded plugins: fastestmirror
Setting up Remove Process
No Match for argument: python3.3
Loading mirror speeds from cached hostfile
* base: ftp.plusline.de
* extras: ftp.plusline.de
* updates: ftp.plusline.de
No Packages marked for removal
root@nikos [~]#


i don'y understand, why didnt it removed it neither of ways?
 
Í

Íéêüëáïò Êïýñáò

root@nikos [~]# which python
/usr/bin/python
root@nikos [~]# which python2
/usr/bin/python2
root@nikos [~]# which python3
/root/.local/lib/python2.7/bin/python3
root@nikos [~]# which python3.3
/root/.local/lib/python2.7/bin/python3.3
root@nikos [~]#

So i have
2.6
2.7
3
3.3

4 installations?
 
I

Ian Kelly

root@nikos [~]# ls -al /usr/bin/python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python*
lrwxrwxrwx 1 root root 6 Apr 5 20:34 /usr/bin/python2 -> python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6*
-rwxr-xr-x 1 root root 1418 Feb 22 02:00 /usr/bin/python2.6-config*
lrwxrwxrwx 1 root root 24 Apr 7 22:10 /usr/bin/python3 -> /opt/python3/bin/python3*
lrwxrwxrwx 1 root root 16 Apr 5 20:35 /usr/bin/python-config -> python2.6-config*
root@nikos [~]#

so, i should just 'yum remove python3' ?

If you're not using it, and if yum isn't going to remove anything else
that has it as a dependency, then go ahead.

On the other hand, there's really not much harm in leaving it. Python
2.6 is already your default Python.

Is this the same system where you recently spent a lot of time
upgrading your web scripts to Python 3?
 
I

Ian Kelly

root@nikos [~]# which python
/usr/bin/python
root@nikos [~]# which python2
/usr/bin/python2
root@nikos [~]# which python3
/root/.local/lib/python2.7/bin/python3
root@nikos [~]# which python3.3
/root/.local/lib/python2.7/bin/python3.3
root@nikos [~]#

So i have
2.6
2.7
3
3.3

4 installations?

Oh, I see. The python3 and python3.3 are probably the same binary, though.

In any case, since Python 2.7 and Python 3 are both installed under
/root/.local, it looks like you didn't install them using yum in the
first place. You probably installed them from source. If that's the
case, you can probably just rm -rf the python2.7 folder from each of
the /root/.local subfolders that has it.
 
Í

Íéêüëáïò Êïýñáò

Ôç ÐáñáóêåõÞ, 31 ÌáÀïõ 2013 8:24:26 ì.ì.. UTC+3, ï ÷ñÞóôçò Ian Ýãñáøå:
On the other hand, there's really not much harm in leaving it. Python
2.6 is already your default Python.
Is this the same system where you recently spent a lot of time
upgrading your web scripts to Python 3?

Yes, its the same system but it reports python 4 times.
I just hate seeing this:

root@nikos [~]# which python
/usr/bin/python
root@nikos [~]# which python2
/usr/bin/python2
root@nikos [~]# which python3
/root/.local/lib/python2.7/bin/python3
root@nikos [~]# which python3.3
/root/.local/lib/python2.7/bin/python3.3
root@nikos [~]#

and this too:
root@nikos [~]# ls -al /usr/bin/python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python*
lrwxrwxrwx 1 root root 6 Apr 5 20:34 /usr/bin/python2 -> python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6*
-rwxr-xr-x 1 root root 1418 Feb 22 02:00 /usr/bin/python2.6-config*
lrwxrwxrwx 1 root root 24 Apr 7 22:10 /usr/bin/python3 -> /opt/python3/bin/python3*
lrwxrwxrwx 1 root root 16 Apr 5 20:35 /usr/bin/python-config -> python2.6-config*
root@nikos [~]#

How can i fix this please.

i just want to leave 2.7 and downlaod 3.3.2
could you please tell me what commands i should issue?
 
Í

Íéêüëáïò Êïýñáò

OMG i gave by mistake

root@nikos [/]# rm -rf /root/.local/

did i screwed up my remote VPS which i host 10 peoples webpages?
 
I

Ian Kelly

OMG i gave by mistake

root@nikos [/]# rm -rf /root/.local/

did i screwed up my remote VPS which i host 10 peoples webpages?

I don't know, is that where you were keeping the data?

The website still appears to be working, as best I can tell from this
computer. I've never actually been able to view it from here, because
I get a UnicodeDecodeError at this line:

host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]

But at least I'm still seeing that error, so the server is still
responding to requests.
 
Í

Íéêüëáïò Êïýñáò

Ôç ÐáñáóêåõÞ, 31 ÌáÀïõ 2013 8:55:51 ì.ì.. UTC+3, ï ÷ñÞóôçò Ian Ýãñáøå:
OMG i gave by mistake
root@nikos [/]# rm -rf /root/.local/
did i screwed up my remote VPS which i host 10 peoples webpages?



I don't know, is that where you were keeping the data?



The website still appears to be working, as best I can tell from this

computer. I've never actually been able to view it from here, because

I get a UnicodeDecodeError at this line:



host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]



But at least I'm still seeing that error, so the server is still

responding to requests.

Everything seem to be workign as expected, my webiste and the other 10 client websites just chhecked.

luckily i keep my stuff at /homw/nikos so there are untouched.
i hope i havent deleted anything though system need form /root/.local but iguess this is where root's user personal stuff and instalation of python from source where. i ddidnt know if it has soemhtign else.

root@nikos [/]# which python
/usr/bin/python
root@nikos [/]# which python3
/root/.local/lib/python2.7/bin/python3
root@nikos [/]# which python3.3
/usr/local/bin/python3.3
root@nikos [/]# ls -l /usr/bin/py
pydoc pygettext.py python python2.6 python3
pyflakes pynche python2 python2.6-config python-config
root@nikos [/]# ls -l /usr/bin/python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python*
lrwxrwxrwx 1 root root 6 Apr 5 20:34 /usr/bin/python2 -> python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6*
-rwxr-xr-x 1 root root 1418 Feb 22 02:00 /usr/bin/python2.6-config*
lrwxrwxrwx 1 root root 24 Apr 7 22:10 /usr/bin/python3 -> /opt/python3/bin/python3*
lrwxrwxrwx 1 root root 16 Apr 5 20:35 /usr/bin/python-config -> python2.6-config*
root@nikos [/]#

please tell me how to unistall python 2.6 and just keep 2.7
and install 3.3.2 please uisng yum.

yum install python3 doesnt work for me.
 
F

Fábio Santos

OMG i gave by mistake
root@nikos [/]# rm -rf /root/.local/
did i screwed up my remote VPS which i host 10 peoples webpages?

Couldn't you check ten websites which are your responsibility, instead of
asking this list?
Everything seem to be workign as expected, my webiste and the other 10
client websites just chhecked.

Good.
please tell me how to unistall python 2.6 and just keep 2.7
and install 3.3.2 please uisng yum.

yum install python3 doesnt work for me.

No. Wait. Why are you uninstalling python 2.6? Because you have too many
python installations?

If you're on a production server with client data, should you really have a
root shell?
 
D

David

Why so many pythons in my system.

Explained below, underneath each pertinent info you provided.

First, let's discuss Python 2.6:

I'am using CentOS v6.4 on my VPS and hence 'yum' install manager and i just
tried:

Code:
root@nikos [~]# which python
/usr/bin/python

This is the version of that CentOS 6 is using. It is Python 2.6 as
shown in the next paragraph. This version is essential to CentOS 6.
This cannot be changed or upgraded without so much work that no sane
person on the planet would bother. Stop worrying about it.

root@nikos [~]# python -V
Python 2.6.6

See above.

root@nikos [/]# ls -l /usr/bin/python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python*
lrwxrwxrwx 1 root root 6 Apr 5 20:34 /usr/bin/python2 -> python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6*
-rwxr-xr-x 1 root root 1418 Feb 22 02:00 /usr/bin/python2.6-config*
[... python3 line removed for clarity ...]
lrwxrwxrwx 1 root root 16 Apr 5 20:35 /usr/bin/python-config ->
python2.6-config*

Apart from the bizarre trailing '*' characters which for which I have
no sane explanation, all of the above is standard for Python 2.6 which
is essential for Centos 6. Stop worrying about it.

Now let's talk about yum:

root@nikos [~]# yum remove python3 [...]
No Match for argument: python3 [...]
root@nikos [~]# yum remove python3.3 [...]
No Match for argument: python3.3

i don'y understand, why didnt it removed it neither of ways?

Your yum setup does not find python3 or python3.3 packages.
So you could not have used yum to install it.
Therefore, you cannot use yum to remove it.
And, you cannot use yum to install it.

Now let's talk about Python 2.7:

root@nikos [~]# which python3
/root/.local/lib/python2.7/bin/python3

There's a python2.7 directory there under /root/.local. Maybe you
installed python2.7 from source using some kind of 'make install'
command (ie not using yum)? If so, and you wish to remove it, there
will probably be another 'make' command to remove it, which must be
run from the same directory that you ran 'make install'. Try 'make
help' in that directory. Maybe someone else can explain why there is a
python3 command under that directory, because I can't.

Now let's talk about Python 3:

root@nikos [~]# ls -al /usr/bin/python* [...]
lrwxrwxrwx 1 root root 24 Apr 7 22:10 /usr/bin/python3 ->
/opt/python3/bin/python3*

There's a python3 directory there under /opt. Maybe you installed
python3 from source using some kind of 'make install' command (ie not
using yum)? If so, and you wish to remove it, there will probably be
another 'make' command to remove it, which must be run from the same
directory that you ran 'make install'. Try 'make help' in that
directory.

OMG i gave by mistake

root@nikos [/]# rm -rf /root/.local/

did i screwed up my remote VPS which i host 10 peoples webpages?

When trying something you don't fully understand, first experiment
somewhere you don't care if bad things happen.

Should i remove them all and install the latest?

No. Different versions do different things. Don't install or remove
them until you understand the different things they do.
 
Í

Íéêüëáïò Êïýñáò

Indeed i have comiled python 2.7 and 3.3 form source after wget and
../configure an make install

but i belive somehting is mixed up althouh python works ok.

root@nikos [/opt/python3/bin]# ls -al
total 15180
drwxr-xr-x 2 root root 4096 Apr 7 22:09 ./
drwxr-xr-x 6 root root 4096 Apr 7 22:09 ../
lrwxrwxrwx 1 root root 8 Apr 7 22:09 2to3 -> 2to3-3.3*
-rwxr-xr-x 1 root root 103 Apr 7 22:09 2to3-3.3*
lrwxrwxrwx 1 root root 7 Apr 7 22:09 idle3 -> idle3.3*
-rwxr-xr-x 1 root root 101 Apr 7 22:09 idle3.3*
lrwxrwxrwx 1 root root 8 Apr 7 22:09 pydoc3 -> pydoc3.3*
-rwxr-xr-x 1 root root 86 Apr 7 22:09 pydoc3.3*
lrwxrwxrwx 1 root root 9 Apr 7 22:09 python3 -> python3.3*
-rwxr-xr-x 2 root root 7757695 Apr 7 22:09 python3.3*
lrwxrwxrwx 1 root root 17 Apr 7 22:09 python3.3-config ->
python3.3m-config*
-rwxr-xr-x 2 root root 7757695 Apr 7 22:09 python3.3m*
-rwxr-xr-x 1 root root 1980 Apr 7 22:09 python3.3m-config*
lrwxrwxrwx 1 root root 16 Apr 7 22:09 python3-config ->
python3.3-config*
lrwxrwxrwx 1 root root 10 Apr 7 22:09 pyvenv -> pyvenv-3.3*
-rwxr-xr-x 1 root root 238 Apr 7 22:09 pyvenv-3.3*
root@nikos [/opt/python3/bin]# make help
make: *** No rule to make target `help'. Stop.
root@nikos [/opt/python3/bin]#


cant remove it.

Why you say i cant just yum install python3.3.2

that way it would be installed correcttly automaticall by yum manager
and if later i want to remove ot to install 3.3.3 or a later version i
would have to do yum remove python3.3.2

but yum cant seem to find any python packages to install.

Still i feel my system is a bit messed p and i just want to leave the
2.6 installed and remove all the rest python and then yum install
the_latest_one.
 
C

Chris Angelico

root@nikos [/]# ls -l /usr/bin/python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python*
lrwxrwxrwx 1 root root 6 Apr 5 20:34 /usr/bin/python2 -> python*
-rwxr-xr-x 3 root root 4864 Feb 22 02:00 /usr/bin/python2.6*
-rwxr-xr-x 1 root root 1418 Feb 22 02:00 /usr/bin/python2.6-config*
[... python3 line removed for clarity ...]
lrwxrwxrwx 1 root root 16 Apr 5 20:35 /usr/bin/python-config ->
python2.6-config*

Apart from the bizarre trailing '*' characters which for which I have
no sane explanation...

I believe that indicates that his 'ls' is aliased to 'ls --classify',
which puts * after executables (and / after directories, and @ after
symlinks, also a few others). Not a problem.

ChrisA
 
C

Chris Angelico

Still i feel my system is a bit messed p and i just want to leave the
2.6 installed and remove all the rest python and then yum install
the_latest_one.

It's not half as messed up as... uhh, scratch that. It's not half as
messed up as the testbox I have at work. (Yeah, we'll go with that.
More courteous.) You do not have a problem there that is worth
breaking your system for.

ChrisA
 
I

Ian Kelly

Indeed i have comiled python 2.7 and 3.3 form source after wget and
./configure an make install

but i belive somehting is mixed up althouh python works ok.

root@nikos [/opt/python3/bin]# ls -al
...
root@nikos [/opt/python3/bin]# make help
make: *** No rule to make target `help'. Stop.
root@nikos [/opt/python3/bin]#


cant remove it.

The Makefile would be located in the source directory where you built
Python, not in the installation directory. But in any case, I don't
think the Python Makefile includes an uninstall option. If you want
to uninstall Python that was built from source, you need to remove the
files by hand.
Why you say i cant just yum install python3.3.2

Because CentOS 6 evidently does not provide a package for any version
of Python other than 2.6. If you want to install another version, you
will need to do it from source.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top