CentOS下使用yum安装的Python版本是2.6.6,若要安装3.3.0版本,需要下载源码
以root用户运行
./configure --prefix=/usr/local/python3
make
make install
安装IDLE开发环境
sudo yum install python-tools
IDLE can't import Tkinter. Your Python may not be configured for Tk. 错误解决
sudo yum install tk-devel tcl-devel
//重新编译安装python3.3.0
sudo rm /usr/local/python3 -rf
./configure --prefix=/usr/local/python3
make
make install
注意:每次编译安装python3后,都需要配置相关环境变量,执行source命令(临时方案)或者重启计算机,使环境变量生效,才能使用python3和idle3命令。