卸载python2.7_如何卸载Python2.6

本文介绍了如何在已预装Python 2.6的Fedora 11系统上安装Python 2.7,并通过修改环境变量使其成为默认版本。同时探讨了不卸载系统自带Python的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1586010002-jmsa.png

On my Fedora11 machine which has python2.6 pre-installed on it, I was able to successfully install python 2.7 using the following 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 will I make the system use python2.7 as its default python?

Or if possible, how will I uninstall python2.6?

Thanks in advance!

解决方案

Uninstalling the system Python is a bad idea. There are many other packages and softwares that depend on it. It'll be better that you use python2.7 by either modifying the $PATH or creating an alias e.g. python2.7 that points to the python that you installed in /opt dir.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值