ITPub博客

首页 > Linux操作系统 > Linux操作系统 > CentOS5.6安装Ipython

CentOS5.6安装Ipython

原创 Linux操作系统 作者:njlovebb 时间:2012-12-26 15:59:14 0 删除 编辑
安装Ipython 需要Python 版本在2.6以上
首先下载Python 2.7.3
http://www.python.org/getit/
解压
#tar -vxjf Python-2.7.3.tar.bz2

# ./configure --prefix=/usr/local/Python

# make&& make install

#mv /usr/bin/python /usr/bin/python_old  

#ln -s /usr/local/Python/bin/python /usr/sbin/python

查看版本
[root@localhost /]# python
Python 2.7.3 (default, Dec 26 2012, 16:04:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

 下载 Ipython
http://ipython.org/download.html#
#tar -zvxf ipython-0.13.tar.gz
python 提供了一个脚本用于安装

# python setup.py install

# ln -s /usr/local/Python/bin/ipython /usr/sbin/ipython


测试一下
[root@localhost /]# ipython
WARNING: IPython History requires SQLite, your history will not be saved
Python 2.7.3 (default, Dec 26 2012, 16:04:03)
Type "copyright", "credits" or "license" for more information.
IPython 0.13 -- 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  subprocess
In [2]: subprocess.call("df -h",shell=True)
文件系统              容量  已用 可用 已用% 挂载点
/dev/sda7              76G   25G   47G  35% /
/dev/sda5              92M   17M   70M  20% /boot
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sdb1              20G   20G  183M 100% /media/disk
/dev/sdc1             1.7G  1.3G  476M  73% /media/disk-1

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20456558/viewspace-751673/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-10-10

  • 博文量
    12
  • 访问量
    58616