[[email protected] ~]# wget -c http://www.dwhd.org/script/tar_gz_bz2/Python-2.7.10.tar.xz [[email protected] ~]# wget -c http://www.dwhd.org/script/tar_gz_bz2/ipython-3.0.0.tar.gz [[email protected] ~]# yum install readline-devel sqlite-devel -y #这里如果不安装readline-devel,后面编译的python将没有删除功能 #这里如果不安装sqlite-devel,后面的iPython将报错(WARNING: IPython History requires SQLite, your history will not be saved) [[email protected] ~]# tar xf Python-2.7.10.tar.xz [[email protected] ~]# tar xf ipython-3.0.0.tar.gz [[email protected] ~]# cd Python-2.7.10/ [[email protected] ~/Python-2.7.10]# ./configure --prefix=/usr/local/python2.7.10 [[email protected] ~/Python-2.7.10]# make -j $(awk '/processor/{i++}END{print i}' /proc/cpuinfo) && make install [[email protected] ~/Python-2.7.10]# cd ../ipython-3.0.0/ [[email protected] ~/ipython-3.0.0]# /usr/local/python2.7.10/bin/python2.7 setup.py build [[email protected] ~/ipython-3.0.0]# /usr/local/python2.7.10/bin/python2.7 setup.py install [[email protected] ~/ipython-3.0.0]# cd .. [[email protected] ~]# ln -sv /usr/local/python2.7.10/bin/ipython /usr/bin/ "/usr/bin/ipython" -> "/usr/local/python2.7.10/bin/ipython" [[email protected] ~]# ln -sv /usr/local/python2.7.10/bin/python2.7 /usr/bin/ "/usr/bin/python2.7" -> "/usr/local/python2.7.10/bin/python2.7" [[email protected] ~]# ipython -c "print 'hello'" hello
下面来看看是否成功
[[email protected] ~]# ipython Python 2.7.10 (default, Aug 27 2015, 01:19:59) Type "copyright", "credits" or "license" for more information. IPython 3.0.0 -- 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]: import platform In [2]: platform.uname() Out[2]: ('Linux', 'Legion10.dwhd.org', '2.6.32-573.3.1.el6.centos.plus.x86_64', '#1 SMP Fri Aug 14 01:00:05 UTC 2015', 'x86_64', 'x86_64') In [3]: platform. platform.DEV_NULL platform.node platform.python_implementation platform.system platform.architecture platform.os platform.python_revision platform.system_alias platform.dist platform.platform platform.python_version platform.uname platform.java_ver platform.popen platform.python_version_tuple platform.version platform.libc_ver platform.processor platform.re platform.win32_ver platform.linux_distribution platform.python_branch platform.release platform.mac_ver platform.python_build platform.string platform.machine platform.python_compiler platform.sys In [3]: exit [[email protected] ~]#
2015年8月28日 下午1:09 1F
这个和virtualenv相比有啥优劣?