Is there a programmatic way to find out which pandas versions are compatible with specific python and numpy configurations?
My interest is to get pandas going within ESRI ArcMAP 10.1, which runs on 32-bit Windows and is built on python 2.7, numpy 1.6.
I tried creating a conda environment for Python compatible with ESRI ArcMap 10.1 by opening a 32-bit Anaconda command prompt and typing
conda create -n arcmap101 python=2.7 numpy=1.6 pandas
and I get back a Python environment that contains pandas=0.10.1
It seems however that it should be possible to build higher versions with python=2.7
, numpy=1.6
, but I’m just not sure how much higher.
I tried looking at the history of the pandas setup.py on github and there is a min_numpy_ver=1.6
right up through pandas=0.14
although recently the requirement was changed to min_numpy_ver=1.7
, so I don’t know if that was a new requirement or a bug fix that should have been added at an earlier release level.
And I see that on PyPI, pandas=0.11
on Windows was built against numpy=1.6
, while for pandas=0.12
, it was built against numpy=1.7
.
But I don’t know if the PyPI build was a requirement or a choice.
Is there any good way to find these things out without just asking the pandas developers?
Advertisement
Answer
Every package that is built against numpy with conda has that numpy major version hard-coded as a dependency. This version is also reflected in the build string (like np18py27
). This is perhaps overcautious, as many packages do not use backwards incompatible parts of the numpy API (and in particular, not all packages actually compile C extensions against numpy), but one way or another, it’s how it’s done.
Continuum stopped building against older versions of numpy when 1.8 was released, which is why conda gives you an older version of pandas when you tell it to install alongside numpy 1.6. To see what is there, run conda search pandas
, and make note of the build strings.
If you need a numpy/pandas combination that is not available, you have two options:
Manually install the “wrong” pandas and hope that it works. The numpy API is theoretically backwards compatible, so there is hope here. It might be worth running the pandas tests after doing this to see if it really does work, though. Something like
conda create -n arcmap101 python=2.7 numpy=1.6 pandas
conda install -n arcmap101 --no-deps pandas=0.13 # Or whatever version
This will put your environment in a state that conda will view as inconsistent, but the packages will be installed there. You can specify the exact version of pandas, down to the build string like
pandas=0.13.0=np17py27_0
Build your own pandas package with the combinations you want.
conda skeleton pypi pandas
will give you a recipe that is a good start (nothing special is needed in the build.sh, or patches required, at least according the the recipe we are using here at Continuum). Then build it withconda build --npy 1.6 --py 2.7 pandas