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

今天安裝了一個centos 6.9  ,查看默認python版本是2.6,因此準備升級,按着之前在ubuntu上的升級步驟:python

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

(2)  tar -xzvf Python-3.3.0.tgzcentos

(3)  mkdir /usr/local/pythonide

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

   在第四步出現了一個提示:orm

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

    原來是缺乏C編譯器,須要安裝GCC套件,因而採用以下命令安裝,get

(5)  yum -y install gcc編譯器

    順利下載安裝成功,重複操做第四步命令:  ./configure --prefix=/usr/local/python3  順利配置成功it

(6)  make 編譯

    make install

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

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

相關文章
相關標籤/搜索