windows下python2和python3同時安裝ipython


1.ipython簡介:

IPython 是一個 python 的交互式 shell,比默認的python shell 好用得多,支持變量自動補全,自動縮進,支持 bash shell 命令,內置了許多很有用的功能和函數

2.安裝

pip install ipython
pip3 install ipython

想讓winodows 下支持pip3,請參考:

 windows下python2和python3共存

3.使用

執行ipython

C:\Users\wanlifeipeng>ipython
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel
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.

發現ipython調用的是python3.4解析器

由於windows中已經安裝了cygwin,執行which ipython,發現了解決方法:

C:\Users\wanlifeipeng>which ipython
/cygdrive/c/Python34/Scripts/ipython

4.解決方法:

將C:\Python34\Scripts目錄下的ipython重命名為ipython3

5.效果:

C:\Users\wanlifeipeng>ipython
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Int
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.
C:\Users\wanlifeipeng>ipython3
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel
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.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM