当前位置:首页 > Python教程 > python技巧

centOS升级python2至python3过程中遇到configure: error: no acceptable C compiler found in $PATH

今天安装了一个centos 6.9  ,查看默认python版本是2.6,所以准备升级,按着以前在ubuntu上的升级步骤:

(1)  wget http://www.python.org/ftp/python/3.3.0/Python-3.3.0.tgz

(2)  tar -xzvf Python-3.3.0.tgz

(3)  mkdir /usr/local/python

(4) ./configure --prefix=/usr/local/python3

   在第四步出现了一个提示:

 提示:configure: error: no acceptable C compiler found in $PATH

    原来是缺少C编译器,需要安装GCC套件,于是采用如下命令安装,

(5)  yum -y install gcc

    顺利下载安装成功,重复操作第四步命令:  ./configure --prefix=/usr/local/python3  顺利配置成功

(6)  make 

    make install

(7)  mv /usr/bin/python /usr/bin/python_old2

(8)  ln -s /usr/local/python3/bin/python3/usr/bin/python


本文出自 “豆爸的博客” 博客,请务必保留此出处http://imlearner.blog.51cto.com/9615100/1978523

原文:http://imlearner.blog.51cto.com/9615100/1978523


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!