您好,登錄后才能下訂單哦!
IPython是python的一個第三方庫,本來使用pip(類似于linux的yum)工具是很容易安裝的,但是因為版本原因有時會出些問題,比如2.7.x版本的不能安裝IPython的最新版本,會報錯:
報錯如下:
[root@iZ2ze7qh7q0di3qkvef1dzZ ~]# pip install ipython Looking in indexes: http://mirrors.aliyun.com/pypi/simple/ Collecting ipython Downloading http://mirrors.aliyun.com/pypi/packages/f3/c3/6c0af5b99d9551fa7b33c674d8f1232033678dcc817098e7a4ac8cd0baf1/ipython-7.1.1.tar.gz (5.1MB) 100% |████████████████████████████████| 5.1MB 97.5MB/s Complete output from command python setup.py egg_info: IPython 7.0+ supports Python 3.5 and above. When using Python 2.7, please install IPython 5.x LTS Long Term Support version. Python 3.3 and 3.4 were supported up to IPython 6.x. See IPython `README.rst` file for more information: https://github.com/ipython/ipython/blob/master/README.rst Python sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0) detected. ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-MKVcGm/ipython/
這時候就需要一種方法來測試下當前都有什么版本,用如下命令 pip install ipython==0000,0000是胡亂寫的,這樣就會提示所有的版本,我們找一個中間的,別太新就行,本例是用5.3.0
(helloworld) [root@iZ2ze7qh7q0di3qkvef1dzZ bin]# pip install ipython==0000 Looking in indexes: http://mirrors.aliyun.com/pypi/simple/ Collecting ipython==0000 Could not find a version that satisfies the requirement ipython==0000 (from versions: 0.10, 0.10.1, 0.10.2, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.13.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 4.0.0b1, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.1.0rc1, 4.1.0rc2, 4.1.0, 4.1.1, 4.1.2, 4.2.0, 4.2.1, 5.0.0b1, 5.0.0b2, 5.0.0b3, 5.0.0b4, 5.0.0rc1, 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.2.2, 5.3.0, 5.4.0, 5.4.1, 5.5.0, 5.6.0, 5.7.0, 5.8.0, 6.0.0rc1, 6.0.0, 6.1.0, 6.2.0, 6.2.1, 6.3.0, 6.3.1, 6.4.0, 6.5.0, 7.0.0b1, 7.0.0rc1, 7.0.0, 7.0.1, 7.1.0, 7.1.1) No matching distribution found for ipython==0000 (helloworld) [root@iZ2ze7qh7q0di3qkvef1dzZ bin]# (helloworld) [root@iZ2ze7qh7q0di3qkvef1dzZ bin]# (helloworld) [root@iZ2ze7qh7q0di3qkvef1dzZ bin]# pip install ipython==5.3.0
安裝之后查下都安裝了那些組件用pip list
(helloworld) [root@iZ2ze7qh7q0di3qkvef1dzZ bin]# pip list Package Version ---------------------------------- ------- backports.shutil-get-terminal-size 1.0.0 decorator 4.3.0 enum34 1.1.6 ipython 5.3.0 ipython-genutils 0.2.0 pathlib2 2.3.2 pexpect 4.6.0 pickleshare 0.7.5 pip 18.1 prompt-toolkit 1.0.15 ptyprocess 0.6.0 Pygments 2.2.0 redis 2.10.6 scandir 1.9.0 setuptools 40.5.0 simplegeneric 0.8.1 six 1.11.0 traitlets 4.3.2 wcwidth 0.1.7 wheel 0.32.2
現(xiàn)在ipython就可以用了
(helloworld) [root@iZ2ze7qh7q0di3qkvef1dzZ bin]# ipython Python 2.7.5 (default, Aug 4 2017, 00:39:18) Type "copyright", "credits" or "license" for more information. IPython 5.3.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]: print " hello world" hello world
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。