ipython的安裝

linuxpython的查看

[root@centOS64A67 ~]# uname -r             //查看內核版本

2.6.32-573.el6.x86_64                                                   //我的CentOs6.7呵呵

[root@centOS64A67 ~]# rpm -q python         //查看安裝的pythonrpm

python-2.6.6-64.el6.x86_64

[root@centOS64A67 ~]# python -V                            //python版本

Python 2.6.6

[root@centOS64A67 ~]# python                                 //進入python

Python 2.6.6 (r266:84292, Jul 23 2015,15:22:56)

[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] onlinux2

Type "help","copyright", "credits" or "license" for moreinformation.

>>> print 'hello world'                                  //學過編程的童鞋們是不是對這兩個單詞和熟悉

hello world

>>> exit()                                                         //      退出

 

ipython 的安裝   ,據說有補齊功能,so。。。。

要安裝ipython先要用pip install ipython ,那pip這個軟件包在哪裏呢

我們使用yum安裝rpm包時,經常遇到一些包沒有,這時候你可以嘗試安裝epel的擴展源,這裏有很多系統不自帶的rpm包。
[root@localhost~]# yum install -y epel-release
[root@localhost~]# yum list 
你會發現最右側出現很多epelrpm包。同時會在yum.repos.d產生兩個文件

 [[email protected]]# ll

總用量 32

-rw-r--r--. 1 root root 1991 8   4 2015 CentOS-Base.repo

-rw-r--r--. 1 root root  647 8   4 2015 CentOS-Debuginfo.repo

-rw-r--r--. 1 root root  289 8   4 2015 CentOS-fasttrack.repo

-rw-r--r--. 1 root root  630 8   4 2015 CentOS-Media.repo

-rw-r--r--. 1 root root 6259 8   4 2015 CentOS-Vault.repo

-rw-r--r--  1 root root 957 11  5 2012 epel.repo

-rw-r--r--  1 root root 1056 11  5 2012epel-testing.repo

 

[root@centOS64A67 yum.repos.d]# pip installipython

         Successfullyinstalled backports.shutil-get-terminal-size-1.0.0 decorator-4.0.9ipython-4.2.0    ipython-genutils-0.1.0

        pathlib2-2.1.0 pexpect-4.0.1pickleshare-0.7.2 ptyprocess-0.5.1 setuptools-21.0.0    simplegeneric-0.8.1 six-1.10.0 traitlets-4.2.1

         //貌似安裝成功?

[root@centOS64A67 yum.repos.d]# pip list  //有個ipython4.2.0

You are using pip version 7.1.0, howeverversion 8.1.1 is available.

You should consider upgrading via the 'pipinstall --upgrade pip' command.

argparse (1.2.1)

backports.shutil-get-terminal-size (1.0.0)

decorator (4.0.9)

distribute (0.6.10)

ethtool (0.6)

iniparse (0.3.1)

ipython (4.2.0)

ipython-genutils (0.1.0)

iwlib (1.0)

ordereddict (1.2)

pathlib2 (2.1.0)

pexpect (4.0.1)

pickleshare (0.7.2)

pip (7.1.0)

ptyprocess (0.5.1)

pycurl (7.19.0)

pygpgme (0.1)

python-dmidecode (3.10.13)

pyxdg (0.18)

setuptools (21.0.0)

simplegeneric (0.8.1)

six (1.10.0)

traitlets (4.2.1)

urlgrabber (3.9.1)

yum-metadata-parser (1.1.2)

[root@centOS64A67 yum.repos.d]# ipython   //能用否,果然說的一樣版本不對,下面貌似也這麼說

Traceback (most recent call last):

 File "/usr/bin/ipython", line 7, in <module>

   from IPython import start_ipython

 File "/usr/lib/python2.6/site-packages/IPython/__init__.py",line 34, in <module>

   raise ImportError('IPython requires Python version 2.7 or 3.3 orabove.')

ImportError: IPython requires Pythonversion 2.7 or 3.3 or above.

 

[root@centOS64A67 ~]# pip install ipython==1.2.1  //指定要求的版

ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org',port=443): Read timed out.//這破網,唉

[root@centOS64A67 ~]# pip install ipython==1.2.1  //繼續

 Downloading ipython-1.2.1.tar.gz (8.7MB)

   100% |████████████████████████████████| 8.7MB 17kB/s

Installing collected packages: ipython

 Found existing installation: ipython 4.2.0

   Uninstalling ipython-4.2.0:

     Successfully uninstalled ipython-4.2.0

 Running setup.py install for ipython

Successfully installedipython-1.2.1      //最愛看Successfully installed

[root@centOS64A67~]# ipython

Python2.6.6 (r266:84292, Jul 23 2015, 15:22:56)

Type"copyright", "credits" or "license" for moreinformation.

 

IPython1.2.1 -- An enhanced Interactive Python.

?         -> Introduction and overview ofIPython's features.

%quickref-> Quick reference.

help      -> Python's own help system.

object?   -> Details about 'object', use 'object??'for extra details.

In[1]: pr

%%prun      %precision  %profile   %prun       print       property //果然帶補齊功能,呵呵

In[1]: print 'hello world'

helloworld

 

 

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章