Subject: Marine Geospatial Ecology Tools (MGET) help
Text archives
RE: [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed
Chronological Thread
- From: Jason Roberts <>
- To: Rui Prieto <>, Marta Tobeña <>
- Cc: "" <>
- Subject: RE: [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed
- Date: Wed, 6 Apr 2016 17:15:50 +0000
- Accept-language: en-US
- Authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=duke.edu;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
Hi Rui,
The problem is probably that you installed your own copy of Python (C:\Python27) and have been installing packages to it, while ArcGIS is using its own copy (C:\Python\ArcGIS10.2). The first question is whether you are intentionally running your own Python version for some reason (e.g. for some other Python-based project), or just did that to try to get this tool working. Assuming you do not really want to run your own Python version and are comfortable using the one with ArcGIS, the first thing is to restore your system to the state that ArcGIS expects
1. Make sure you actually do have a C:\Python27\ArcGIS10.2 directory. If not, stop and let me know. 2. Close all ArcGIS programs. 3. Uninstall all the Python stuff you installed yourself. 4. Start a CMD shell as administrator click Start (or whatever it is on Windows 8.1), type CMD, right click on the program and select Run As Adminstrator. 5. Execute the following red command from the CMD shell:
C:\>ftype | findstr "Python" Python.CompiledFile="C:\Python27\ArcGIS10.2\python.exe" "%1" %* Python.File="C:\Python27\ArcGIS10.2\python.exe" "%1" %* Python.NoConFile="C:\Python27\ArcGIS10.2\pythonw.exe" "%1" %*
This displays the Windows file association database and searches for handlers for Python files. You should see these lines but rather than a path of C:\Python27\ArcGIS10.2\, you’ll probably see a path of something else, such as C:\Python27\ (without the ArcGIS10.2). This will mess up ArcGIS. It expects that its own Python interpreter is the default handler for Python files. To fix that, you should run these commands, one after another, from the CMD shell:
ftype Python.CompiledFile="C:\Python27\ArcGIS10.2\python.exe" "%1" %* ftype Python.File="C:\Python27\ArcGIS10.2\python.exe" "%1" %* ftype Python.NoConFile="C:\Python27\ArcGIS10.2\pythonw.exe" "%1" %*
Now your system should be back to the original state after you installed 10.2.2. Hopefully you have pywin32 and MGET (the GeoEco package) installed to there. You should start ArcGIS and run an MGET tool to verify that it will work. For example, if you have R, you could run the MGET tool called Evaluate R Statements and have it evaluate print(1+1) and verify that you got this:
Executing: REvaluate print(1+1) true # # x y z m true # # # Start Time: Wed Apr 06 12:58:32 2016 Running script REvaluate... [1] 2 Completed script REvaluate... Succeeded at Wed Apr 06 12:58:36 2016 (Elapsed Time: 4.19 seconds)
If that does not work, it may be that pywin32 and/or MGET are not installed to this copy of Python. You should install them. (ask me for help if you’re unsure).
Once you can run MGET from the original Python that came with ArcGIS, it is time to install netCDF4 to it. Numpy 1.7.1 came with Arc 10.2.2. Although I could probably tell you want you need to know in a couple of sentences, I’ll spell it out in detail in case others need to reference it:
1. Close all ArcGIS programs.
2. If you have never installed pip before for this copy of Python, do so now. (If you don’t know whether you did before or not, it is ok to do it again.) First download get-pip.py (google for the location of it). Save it on some place on your hard drive. Then run this from the CMD shell, replacing the path to get-pip.py with your own:
C:\>C:\Python27\ArcGIS10.2\python.exe D:\jjr8\Temp\get-pip.py Collecting pip c:\users\jjr8\appdata\local\temp\4\tmpcdskiw\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. c:\users\jjr8\appdata\local\temp\4\tmpcdskiw\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB) 100% |################################| 1.2MB 437kB/s Collecting wheel Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) 100% |################################| 71kB 4.8MB/s Installing collected packages: pip, wheel Successfully installed pip-8.1.1 wheel-0.29.0 c:\users\jjr8\appdata\local\temp\4\tmpcdskiw\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
It gave some complaints related to SSL that are probably related to SSL exploits developed in the last few years. You can ignore these. If you already had pip installed, it will say something like this:
c:\users\jjr8\appdata\local\temp\4\tmp79sg3w\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. c:\users\jjr8\appdata\local\temp\4\tmp79sg3w\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. Requirement already up-to-date: pip in c:\python27\arcgis10.2\lib\site-packages
3. Now download netCDF4-1.1.7+numpy16-cp27-none-win32.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#netcdf4 and save it on your hard disk. Do not download netCDF4-1.2.3.1-cp27-cp27m-win32.whl. This latter one requires a newer version of numpy than that (1.7.1) which comes with ArcGIS 10.2.2.
4. Install it with this command from the CMD shell, replacing the path to the .whl file with that for your own:
C:\>C:\Python27\ArcGIS10.2\Scripts\pip.exe install "D:\jjr8\Temp\netCDF4-1.1.7+numpy16-cp27-none-win32.whl" Processing d:\jjr8\temp\netcdf4-1.1.7+numpy16-cp27-none-win32.whl Requirement already satisfied (use --upgrade to upgrade): numpy>=1.3 in c:\python27\arcgis10.2\lib\site-packages (from netCDF4==1.1.7+numpy16) Installing collected packages: netCDF4 Successfully installed netCDF4-1.1.7
5. Try the MGET OceanColor tool again.
Let me know how that goes.
Best, Jason
From: [mailto:]
On Behalf Of Rui Prieto
Hi Jason and others, have a request for help: while trying to get oceancolor data interpolated to points, we keept getting the error regarding missing netCDF4 module for Python (report reproduced at the end of the message) System (on this machine; the problem is occurring in all machines): ArcGIS 10.2.2.3552 (10.3 on the way but will still take some time to be installed on all machines) Mget: 0.8a62 Actions: 2. installed using pip from command
APPARENTLY it installed well:
3. rebooted PC and tried again; got same error 4. tried with the 64 bit version of the NetCDF4 module and got the same error again; tried the +numpy version at no avail; tried the 32 bit version again, no luck...
Any help will be welcome. Rui Prieto
To unsubscribe from this list, visit: https://lists.nicholas.duke.edu/sympa/ca/initiate_unsubscribe/mget-help/jason.roberts%40duke.edu |
- [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed, Rui Prieto, 04/06/2016
- RE: [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed, Jason Roberts, 04/06/2016
- RE: [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed, Rui Prieto, 04/06/2016
- RE: [mget-help] can't interpolate NASA ocean color; netcdf4 fail; however netcdf4 is installed, Jason Roberts, 04/06/2016
Archive powered by MHonArc 2.6.19.