Subject: Marine Geospatial Ecology Tools (MGET) help
Text archives
From: | Jason Roberts <> |
---|---|
To: | Chris McOwen <>, "" <> |
Subject: | [mget-help] RE: numpy |
Date: | Fri, 27 Feb 2015 17:25:10 +0000 |
Accept-language: | en-US |
Authentication-results: | unep-wcmc.org; dkim=none (message not signed) header.d=none; |
Chris, Sorry I haven’t kept up with the numpy releases. I haven’t had a chance to do any MGET development since last July, until very recently. Right now I’m working
on ArcGIS 10.3 compatibility. I will update numpy compatibility at that time. It will probably take me a few more weeks to do this. The underlying cause of this relates to how performance-sensitive part of MGET are compiled against numpy’s application binary interface (ABI), allowing direct
C calls between MGET and numpy rather than going through the Python interpreter. Because MGET supports so many different versions of ArcGIS, it also must support different versions of numpy. But when numpy changes their ABI, modules that call it (such as MGET)
must recompile against the new ABI or they will crash when they try to call the new one. Numpy has only done this rarely, but to insulate MGET from it, we rebuild the parts of MGET that call the ABI each time a new numpy is released. As you may have discovered, the latest version of MGET that numpy supports is 1.8.1. Here are two ways you might be able to hack MGET to work before I issue the
new release: 1.
Close ArcGIS. 2.
Rename C:\Python27\ArcGIS10.2\Lib\site-packages\numpy to something else, such as C:\Python27\ArcGIS10.2\Lib\site-packages\numpy_191 3.
Start ArcGIS and run the MGET tool that needs numpy. MGET will load numpy 1.6.1 that it keeps in C:\Python27\ArcGIS10.2\Lib\site-packages\GeoEco\AggregatedModules\numpy
in case the user does not have numpy. 4.
Rename numpy_191 back to numpy. 5.
Continue to use ArcGIS. Until you close it, MGET should continue to use that numpy 1.6.1 even though C:\Python27\ArcGIS10.2\Lib\site-packages\numpy
now exists. But this is only good for that instance of ArcGIS. If you open another instance, you have to do it again. That approach might be more convenient that uninstalling and reinstalling numpy all the time. Alternatively you could try a more complicated one-time hack that
would not require you to do renaming every time you wanted to use MGET. This hack assumes that numpy did not change the ABI between numpy 1.8.1 and 1.9.1. I don’t know if that is true, but it’s worth a shot: 1.
Search the C:\Python27\ArcGIS10.2\Lib\site-packages\GeoEco directory for *_1_8_1.pyd (e.g.
dir C:\Python27\ArcGIS10.2\Lib\site-packages\GeoEco\*_1_8_1.pyd /s from cmd shell). 2.
For each file you find, copy it to a file with the identical name and location except give it _1_9_1.pyd. 3.
Try MGET again. It will try to load the _1_9_1.pyd
files. If the numpy ABI did not change, it will “just work”. If the ABI did change, ArcGIS might crash. 4.
If it works, you’re good to go. You don’t have to do anything else. MGET will continue to use 1.9.1. Let me know if either of those will work for you… Jason From: Chris McOwen [mailto:]
Hi, I am trying to use your tool to convert HDF’s to rasters ( something I will need to do quite regularly) and I get the error message below. I have found a work around which involves downgrading numpy but the problem is
I then need to upgrade it again in order to do other things. I was wondering if there was a plan to release a version of MGET that was compatible? Thanks for your great work on the tool to date, Chris --------------
|