CentOS安装Python总结

字体大小: 中小 标准 ->行高大小: 标准

CentOS下使用yum安装的python版本是2.6.6,若要安装3.3.0版本,需要下载源码http://python.org/ftp/python/3.3.0/Python-3.3.0.tgz

以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命令。

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/64707.html