简体   繁体   English

为python Python 2.7.3导入h5py

[英]importing h5py for python Python 2.7.3

I have ARCGIS 10.2 . 我有ARCGIS 10.2。 When we install this software, python 2.7.3 (on win32) is also installed which we can develop the software by python and by arcpy module. 当我们安装此软件时,还将安装python 2.7.3(在win32上),我们可以通过python和arcpy模块开发该软件。 I want to add h5py to it's library. 我想将h5py添加到它的库中。 My windows is 64 bit and I downloaded both hy5py 32 and 64 bit and copied them to the Lib folder. 我的Windows是64位,我下载了hy5py 32和64位,并将它们复制到Lib文件夹中。 When I open IDLE an try to import it, I encounter with the following error: 当我打开IDLE尝试导入它时,遇到以下错误:

"ValueError: numpy.dtype has the wrong size, try recompiling". “ ValueError:numpy.dtype的大小错误,请尝试重新编译”。

I also copied six. 我还抄了六本。 and I think the problem is with numpy. 而且我认为问题出在numpy。 I replaced the numpy from anaconda(numpy 1.9) with numpy in ARCGIS python Library. 我用ARCGIS python库中的numpy替换了anaconda(numpy 1.9)中的numpy。 Then I could import h5py but I could not open arcpy. 然后,我可以导入h5py,但无法打开arcpy。

I really appreciate for your help 非常感谢您的帮助

It sounds like the NumPy that came with your system was built one way, with one version, then you "installed" (by copying) h5py which was built another way, either with a different version or different options for NumPy. 听起来,系统附带的NumPy是用一种方式构建的,具有一个版本,然后您“安装”(通过复制)h5py(通过另一种方式构建的h5py),或者为NumPy使用了不同的版本或不同的选项。

To fix this, you should try building h5py yourself, which you can do by downloading the Source from here: https://pypi.python.org/pypi/h5py/2.5.0 要解决此问题,您应该尝试自己构建h5py,您可以通过从此处下载源代码来完成: https ://pypi.python.org/pypi/h5py/2.5.0

Or perhaps easier, consider using Pandas. 也许更简单,请考虑使用Pandas。 It can also read and write hdf5 files (though perhaps with fewer arcane features), and it's quite likely that someone has already provided a package for Pandas which is compatible with your existing installation. 它还可以读取和写入hdf5文件(尽管可能具有较少的奥术功能),而且很可能已经有人为Pandas提供了与您现有安装兼容的软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM