cd Python-3.5.0@H_301_5@
4、配置安装位置@H_301_5@
./configure--prefix=/usr/local/python3.5@H_301_5@
注:如果没有安装C语言编译器会提示错误。如果出现错误,在联网的情况下使用 yum install gcc 命令安装gcc编译器@H_301_5@
5、编译@H_301_5@
make@H_301_5@
6、安装@H_301_5@
make install@H_301_5@
7、下载并安装setuptools 18.5@H_301_5@
wget https://bootstrap.pypa.io/ez_setup.py -O - | python@H_301_5@
mv/usr/bin/python/usr/bin/pythonbak@H_301_5@
9、创建新python软连接@H_301_5@
ln-s/usr/local/python3.5/bin/python3.5/usr/bin/python@H_301_5@
10、查看python版本@H_301_5@
python
@H_301_5@
[root@localhost Python-3.5.0]# python Python 3.5.0 (default,Oct 7 2016,04:34:35) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux Type "help","copyright","credits" or "license" for more information.11、修改yum配置文件
vim /usr/bin/yum
@H_301_5@
#!/usr/bin/python python修改为 python2.6 import sys try: import yum except ImportError: print >> sys.stderr,"""\ There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: %s Please install a package which provides this module,or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python,which is: %s If you cannot solve this problem yourself,please go to the yum faq at:原文链接:https://www.f2er.com/centos/380493.html