user308827
user308827

Reputation: 21961

Downgrading and upgrading python libraries using conda

I frequently install python packages using conda, sometimes that involves downgrading an existing installed package. Afterwards, I upgrade the downgraded package to latest version again.

E.g.

conda install -c conda-forge iris

downgrades numpy to 1.10.4 from 1.11.x. Later, I do conda update numpy to go back to 1.11.x

Is this ok to do or can lead to subtle issues later?

Upvotes: 1

Views: 724

Answers (1)

Gustavo Muenz
Gustavo Muenz

Reputation: 9552

tl;dr;

Probably not, since numpy 1.10 -> 1.11 is not a HUGE leap.

Recommended approach

I would advise against not letting conda match the correct versions of each package. You can get wrong results or crashes.

Longer explanation

The recipe for iris was built using numpy 1.10, so if you force numpy back to 1.11, you might have problems such as:

  • crashes: if iris is compiled against NumPy (using its C Api)
  • wrong results: if iris uses an API of numpy changed between versions
  • python exceptions: if iris uses an API of numpy in which the implementation changed between versions.

I know that recently numpy demands that indices of numpy arrays be integers only. This broke some code. I don't remember which version of numpy did that.

This is true for all packages, not only numpy. Some libraries maintain API and/or ABI compatibility between releases, others don't.

All in all, numpy has a fairly stable API. I can't really answer for its ABI, since I don't know.

Upvotes: 2

Related Questions