neversaint
neversaint

Reputation: 64064

How to downgrade IPython4 to 3 using Anaconda

I'm currently using IPython version 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]: 

How can I downgrade it to version 3 (less than 4)?

Upvotes: 6

Views: 8257

Answers (3)

John Morrison
John Morrison

Reputation: 4078

Downgrading in Anaconda is very easy. Some answers point to the correct answer but have unnecessary steps. You can just specify the version even if already installed and Anaconda will handle the dependencies on the included Anaconda packages.

conda install ipython=3

This will downgrade ipython and dependent packages so that they will work with the specified version if need be.

Upvotes: 4

Dimitris Fasarakis Hilliard
Dimitris Fasarakis Hilliard

Reputation: 160647

By using conda remove1 and conda install.

conda remove will remove the current version of ipython:

conda remove ipython 

You can then optionally search for versions of ipython that you want to install with conda search 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 

With the starred entry denoting the current version you have.

Then, use conda install ipython=version_num to install the version you want. Look out for default Python versions required by each ipython version though!


1 As I recently noticed, the conda remove step is obsolete. You can simply list the python versions with conda search and then execute conda install with the version you want, anaconda takes care of the replacement for you:

(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

And you're good to go.

Upvotes: 6

Daniel Milde
Daniel Milde

Reputation: 1194

Try something like:

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

-I means ignoring installed version => reinstalling.

Upvotes: 1

Related Questions