如何使用Anaconda将IPython4降级为3

如何使用Anaconda将IPython4降级为3,python,ipython,anaconda,Python,Ipython,Anaconda,我目前正在使用IPython版本4 $ ipython WARNING: 'inline' not available as pylab backend, using 'auto' instead. Python 2.7.10 |Anaconda 2.1.0 (x86_64)| (default, Oct 19 2015, 18:31:17) Type "copyright", "credits" or "license" for more information. IPython 4.0.

我目前正在使用IPython版本4

$ ipython
WARNING: 'inline' not available as pylab backend, using 'auto' instead.
Python 2.7.10 |Anaconda 2.1.0 (x86_64)| (default, Oct 19 2015, 18:31:17) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.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.
Using matplotlib backend: MacOSX

In [1]: 
如何将其降级到版本3(小于4)?

尝试以下操作:

sudo /opt/anaconda/bin/pip install -I ipython==3.2.2
-I表示忽略已安装的版本=>重新安装。

使用1和

conda remove
将删除当前版本的
ipython

conda remove ipython 
ipython                      0.13                     py27_0  defaults        
                             0.13                     py26_0  defaults        
                             0.13                     py33_1  defaults        
                             0.13                     py27_1  defaults        
                             0.13                     py26_1  defaults        
                             0.13.1                   py33_1  defaults 
... continues..
                             3.2.0                    py27_0  defaults        
                             3.2.1                    py34_0  defaults        
                             3.2.1                    py33_0  defaults        
                             3.2.1                    py27_0  defaults        
                             4.0.0                    py35_0  defaults        
                             4.0.0                    py34_0  defaults        
                          *  4.0.0                    py27_0  defaults 
然后,您可以选择搜索要使用
conda search ipython安装的
ipython
版本:

conda remove ipython 
ipython                      0.13                     py27_0  defaults        
                             0.13                     py26_0  defaults        
                             0.13                     py33_1  defaults        
                             0.13                     py27_1  defaults        
                             0.13                     py26_1  defaults        
                             0.13.1                   py33_1  defaults 
... continues..
                             3.2.0                    py27_0  defaults        
                             3.2.1                    py34_0  defaults        
                             3.2.1                    py33_0  defaults        
                             3.2.1                    py27_0  defaults        
                             4.0.0                    py35_0  defaults        
                             4.0.0                    py34_0  defaults        
                          *  4.0.0                    py27_0  defaults 
带星号的条目表示当前版本

然后,使用
conda install ipython=version\u num
安装所需的版本。请注意每个
ipython
版本所需的默认Python版本


1正如我最近注意到的,
conda remove
步骤已经过时。您只需使用列出python版本,然后使用您想要的版本执行
conda install
,anaconda将为您提供替换:

(myenv)jim@unx: conda install ipython=3.2.0
Fetching package metadata: ....
Solving package specifications: ................

The following packages will be DOWNGRADED:

    ipython: 4.0.1-py27_0 --> 3.2.0-py27_0

Proceed ([y]/n)? y

你可以走了。

在巨蟒中降级非常容易。有些答案指向正确答案,但有不必要的步骤。即使已经安装,您也可以指定版本,并且Anaconda将处理包含的Anaconda软件包上的依赖项

conda install ipython=3
这将降级ipython和依赖包,以便在需要时使用指定的版本