首页 > 解决方案 > 如何将 ipython shell 从 2.7 版切换到 3.6 版

问题描述

我是 python / 编码的新手,最近才开始使用 ipython shell。但是,它自动默认为 python 2.7 版本,我想将其切换到 3.6。感谢有人能指出我正确的方向。我正在使用 MacBook Air。下面是我启动 python shell 时的样子。我安装了两个 Python 版本。

Python 2.7.15 |Anaconda, Inc.| (default, Dec 14 2018, 13:10:39) 
Type "copyright", "credits" or "license" for more information.

IPython 5.8.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.

标签: pythonpython-3.xpython-2.7anacondaipython

解决方案


使用 pip3 安装 ipython,而不是 pip。可能需要先卸载现有版本的 ipython。


推荐阅读