Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade conda version?

I need to downgrade my conda version from 4.3 to 4.2 on my CentOS 6.7 machine. What is the command required to do that?

like image 220
Madhavi Jouhari Avatar asked Jan 17 '17 15:01

Madhavi Jouhari


1 Answers

I wouldn't recommend downgrading conda except when the newly installed (upgraded) version has a critical bug.

But since you asked: You can specify a version by appending ={version} to the packages, this works even for the conda package:

$ conda install conda=4.2

If you want a specific 4.2 version you can also use (for example):

$ conda install conda=4.2.15

Note that downgrading conda can be very risky. After the downgrade your conda could fail completely or work incorrectly. Conda uses a lot of metadata that evolve over time ... so if the downgraded conda version cannot make sense of these - or even worse corrupt them - you'll have a painful experience in how to recover your conda environemnt. Downgrade conda at your own risk (and in my opinion only if really, really necessary)!


In case you already downgraded conda and it's throwing exceptions (for example CondaUpgradeError) at you, then maybe this "section" in an troubleshooting guide in the conda repository may be useful:

Conda upgrade error

Cause

Downgrading conda from 4.6.1 to 4.5.x and then trying to conda install conda or conda upgrade conda will produce a solving and upgrade error similar to the following:

Solving environment: failed
CondaUpgradeError: This environment has previously been operated on by a
conda version that's newer than the conda currently being used. A newer
version of conda is required.
target environment location: /opt/conda
current conda version: 4.5.9
minimum conda version: 4.6

Solution

Change the .condarc file. Set the parameter by editing the .condarc file directly: allow_conda_downgrades: true in conda version 4.5.12. This will then let you upgrade. If you have something older than 4.5.12, install conda 4.6.1 again from the package cache.

EXAMPLE: If my conda info says package cache : /opt/conda/pkgs and my Python version is 3.7, then on the command line, type conda install /opt/conda/pkgs/conda-4.6.1-py37_0.tar.bz2 to resolve the issue.

like image 84
MSeifert Avatar answered Sep 19 '22 14:09

MSeifert