How to remove Python2.6

On my Fedora11 machine on which python2.6 is installed, I was able to successfully install python 2.7 by following these steps:

wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
tar -xvjf Python-2.7.tar.bz2
cd Python*
./configure --prefix=/opt/python27
make
make install
vi ~/.bash_profile
## replaced PATH=$PATH:$HOME/bin
## with PATH=$PATH:$HOME/bin:/opt/python27/bin

## reload .bash_profile
source ~/.bash_profile
echo "/opt/python27/lib" > /etc/ld.so.conf.d/python27.conf
ldconfig

However, when I checked the python version the system uses via terminal (python -V), it still shows python 2.6.

How can I use python2.7 as my python by default? Or, if possible, how to remove python2.6?

Thanks in advance!

+5
source share
5 answers

Removing a Python system is a bad idea. There are many other packages and software that depend on it. It will be better if you use python2.7, either by changing $ PATH, or by creating an alias, for example. python2.7 which points to the python that you installed in / opt dir.

+9

Fedora, python 2.6, , . .

, $PATH ($MAN_PATH ..) . /opt/python27/bin , /usr/bin. , /opt/python 27/bin/python python .

+4

- Python RHEL/CentOS/Fedora. yum Python .

, Python2.7 , , Python2.6 ( whereis python which python), Python2.7

+2

Instead of uninstalling the old version, use the specific python version when using it.

I changed the symbolic link

ln -s /usr/local/bin/python2.7 /usr/local/bin/python

And used

python -m pip install pip --upgrade
0
source

Or you can just use the linux Yum function and execute the command yum remove python, it will remove python and its related dependencies from the system

-5
source

All Articles