【问题标题】:How to downgrade IPython4 to 3 using Anaconda如何使用 Anaconda 将 IPython4 降级到 3
【发布时间】:2016-01-26 15:31:06
【问题描述】:

我目前使用的是 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)?

【问题讨论】:

    标签: python ipython anaconda


    【解决方案1】:

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

    conda install ipython=3
    

    这将降级 ipython 和依赖包,以便它们可以在需要时使用指定的版本。

    【讨论】:

      【解决方案2】:

      通过使用 conda remove1conda install

      conda remove 将删除当前版本的ipython

      conda remove ipython 
      

      然后,您可以选择搜索要使用conda search ipython 安装的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_num 安装您想要的版本。不过,请注意每个 ipython 版本所需的默认 Python 版本!


      1 正如我最近注意到的,conda remove 步骤已过时。您可以简单地使用 conda search 列出 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
      

      你可以走了。

      【讨论】:

        【解决方案3】:

        尝试类似:

        sudo /opt/anaconda/bin/pip install -I ipython==3.2.2
        

        -I 表示忽略已安装的版本 => 重新安装。

        【讨论】:

          猜你喜欢
          • 2018-10-18
          • 2019-05-27
          • 1970-01-01
          • 1970-01-01
          • 2012-08-03
          • 2011-07-24
          • 2013-09-15
          • 2012-08-06
          • 1970-01-01
          相关资源
          最近更新 更多