[iyunv@C6 ~]# pythonPython 2.6.6 (r266:84292, Nov 22 2013, 12:16:22)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
如果想要安装2.7可以额外编译安装一个到指定的路径
第二种方法是使用pyenv
所需要的软件
Python-2.7.13.tgz
ipython-1.2.1.tar.gz
1、安装python
[iyunv@C6 soft]# ls
ipython-1.2.1.tar.gz Python-2.7.13.tgz
[iyunv@C6 soft]# tar xf Python-2.7.13.tgz
[iyunv@C6 soft]# ls
ipython-1.2.1.tar.gz Python-2.7.13 Python-2.7.13.tgz
[iyunv@C6 soft]# cd Python-2.7.13
#configure文件
[iyunv@C6 Python-2.7.13]# ./configure --help
`configure' configures python 2.7 to adapt to many kinds of systems.
[iyunv@C6 Python-2.7.13]# /usr/local/python27/bin/python2.7
Python 2.7.13 (default, Feb 27 2017, 18:23:38)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hello python"hello python
[iyunv@C6 ~]# ipython
WARNING: IPython History requires SQLite, your history will not be saved
Python 2.7.13 (default, Feb 27 2017, 18:23:38)
Type "copyright", "credits" or "license" for more information.
IPython 1.2.1 -- An enhanced Interactive Python.?
-> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: print "hello world"
hello world