Cannot import pandas - ArcGIS 10.1

5973
10
Jump to solution
08-12-2014 10:28 AM
curtvprice
MVP Esteemed Contributor

Trying to get pandas to import, but we are getting what looks like an error caused by a failed dependency of the version of my numpy's compile..

ArcGIS 10.1 SP 1.

>>> import pandas

numpy.dtype has the wrong size, try recompiling

Traceback (most recent call last):

  File "<interactive input>", line 1, in <module>

  File "C:\Python27\ArcGIS10.2\lib\site-packages\pandas\__init__.py", line 6, in <module>

    from . import hashtable, tslib, lib

  File "numpy.pxd", line 157, in init pandas.hashtable (pandas\hashtable.c:22315)

ValueError: numpy.dtype has the wrong size, try recompiling

I check my numpy version:

>>> import numpy

>>> numpy.version.full_version

'1.6.1'

It should work with numpy 1.6.1, according to the doc.

Can we safely upgrade numpy - or is a version of pandas out there that is known to work with the ArcGIS 10.1 python stack?

0 Kudos
1 Solution

Accepted Solutions
RolandViger
New Contributor III

Hi Luke and others,

the "10.2" part is accurate. I only have 10.2 installed and that's the way my SAs organized things. 

Roland

P.S. I've worked w/a colleague yesterday aft to make this work w/Anaconda. I've posted this question to record that solution at arcgis 10.2 - installing pandas w/ESRI python - Geographic Information Systems Stack Exchange‌. If this geonet.esri.com thread yields a different approach, I'm happy to continue. Would really be nice to come up with some more stable than placing a "conda.path" into ESRI's site-packages directory, as that other post will describe.

View solution in original post

10 Replies
XanderBakker
Esri Esteemed Contributor

Maybe James Crandall‌ can have a look. I know he uses Panda a lot.

JamesCrandall
MVP Frequent Contributor

As Xander points out, I am a "user" of Pandas library!

I actually work in a Citrix environment where all software, python libs, etc... are managed services that I use and I am not familiar with installs and the like.

Sorry OP!  Hopefully someone with a better handle on that error can contribute.  (Thanks for the mention Xander)

Edit: quick search found this (I'm not an expert in these matters, but also may be important to check your version against your version of NumPy)... python - ValueError: numpy.dtype has the wrong size, try recompiling - Stack Overflow

0 Kudos
RolandViger
New Contributor III

Hi James (and Xander),

Thanks for the responses (Curtis submitted on my behalf). I saw that post, too. I thought about whether to post my question to stackoverflow but thought it would just get labeled as a duplicate since it was so close in spirit to that one, plus it seems like this might have something to do with how 10.2 has been built up (maybe numpy got recompiled in the ESRI distro?).

I'm hoping someone with some deeper knowledge (than I have) of the ESRI version of numpy might have insight since the version numbers appear to be correct but the compiled artifact isn't matching what pandas is expecting.

0 Kudos
curtvprice
MVP Esteemed Contributor

The option always exists to install another python (Anaconda?) and call it from your ArcGIS script using the subprocess module. This minimizes the chance of screwing up your ArcGIS python install and thus breaking Esri tools by for example, upgrading numpy.

One cool thing I learned at the EsriUC is that the Python distribution (separate python package, not the decapitated python inside the software that Esri tools use) of ArcGIS Pro will include pandas.

Luke_Pinner
MVP Regular Contributor

Is "C:\Python27\ArcGIS10.2"in your traceback just a typo, or have you got/had multiple installs or something else funky going on?

0 Kudos
RolandViger
New Contributor III

Hi Luke and others,

the "10.2" part is accurate. I only have 10.2 installed and that's the way my SAs organized things. 

Roland

P.S. I've worked w/a colleague yesterday aft to make this work w/Anaconda. I've posted this question to record that solution at arcgis 10.2 - installing pandas w/ESRI python - Geographic Information Systems Stack Exchange‌. If this geonet.esri.com thread yields a different approach, I'm happy to continue. Would really be nice to come up with some more stable than placing a "conda.path" into ESRI's site-packages directory, as that other post will describe.

curtvprice
MVP Esteemed Contributor

The standard locations for ArcGIS pythons are

C:\Python27\ArcGIS10.2

C:\Python27\ArcGISx6410.2

0 Kudos
Luke_Pinner
MVP Regular Contributor

I know that Curtis, but your original title is "Cannot import pandas - ArcGIS 10.1" and you specified "ArcGIS 10.1 SP 1" in the body of the post. That's why I questioned the path.

RolandViger
New Contributor III

right. sorry, probably my fault as I relayed info to Curtis. That should have been 10.2 in the original post.

0 Kudos