How to find (and install) the pandas version which is compatible with numpy 1.19.2?

Viewed 1424

I've been fighting for too long trying to install tensorflow-macos and tensorflow-addons on a MacM1 (inside specific conda environments), without success. Thus, I am trying to figure out which libraries are clashing. I realised that tensorflow-macos 2.6 requires numpy 1.19.2, but when I try to install pandas (which I also need) numpy gets updated to 1.21. My questions are:

  • how can I find a pandas version compatible with numpy 1.19.2
  • how should I install it? pip/conda?
1 Answers

There isn't a direct way to get a compatibility matrix, but you can pull down all the info on pandas packages in your channels and filter for the numpy requirements. Something like:

conda search --info pandas | grep -E '(^version|numpy)'

gives output like:

version     : 0.17.0
  - numpy 1.10*
version     : 0.17.0
  - numpy 1.10*
version     : 0.17.0
  - numpy 1.10*
version     : 0.17.0
  - numpy 1.11*
...
version     : 1.3.3
  - numpy >=1.19.2,<2.0a0
version     : 1.3.4
  - numpy >=1.18.5,<2.0a0
version     : 1.3.4
  - numpy >=1.19.5,<2.0a0
version     : 1.3.4
  - numpy >=1.18.5,<2.0a0
version     : 1.3.4
  - numpy >=1.19.5,<2.0a0

But, as commented, the idiomatic usage is to explicitly specify your requirements when creating your environment, like:

conda create -n myenv python=3.8 numpy=1.19.2 pandas

That is, tell Conda everything you want at the outset and it will listen to your needs.

Related