Skip to Content.

mget-help - Re: [mget-help] error code when using MGET models

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


Re: [mget-help] error code when using MGET models


Chronological Thread 
  • From: Sarah Gravem <>
  • To: Jason Roberts <>
  • Cc: "" <>, "Dickens, John" <>
  • Subject: Re: [mget-help] error code when using MGET models
  • Date: Thu, 10 Oct 2019 16:41:48 -0700
  • Authentication-results: mail-gw.oit.duke.edu; spf=pass ; dkim=pass header.d=gmail.com header.s=20161025; dmarc=pass header.from=gmail.com

Hi Jason! 
It worked! I have a model!!!!
Thank you so much. That was amazing help. 
Best,
Sarah

On Thu, Oct 10, 2019 at 11:17 AM Jason Roberts <> wrote:

Hi Sarah,

 

Sorry about that, I forgot about this part of the problem. Python records its installation location in the Windows Registry. When you installed Python 2.7 yourself, it overwrote the registry entries that ArcGIS put there when it installed Python. Then, when you uninstalled the Python that you installed, it removed those registry entries, leaving nothing behind. So the pywin32 installer thinks that no copy of Python 2.7 is installed.

 

The solution is to add the entries back to the registry that ArcGIS originally put there. Please use the following procedure for that. You should do this before step 10 in my original instructions.

 

a.    Cancel the pywin32 installer, if you have not done so already

b.    Start a text editor (e.g. Notepad)

c.    Copy all of the red text appearing after my signature below into the text editor

d.    Save the file to a temporary location. Give it a .reg extension. For example, you could save it to C:\Temp\Python_27_ArcGIS_107.reg.

e.    Close the text editor

 

Again, I could not simply send you a file as an attachment because the email systems would definitely not let it through. Hopefully they won’t balk on me including the text in an email. Please let me know you received it. Anyway, now do this:

 

f.     Start Windows File Explorer and navigate to the directory containing the .reg file

g.    Right click on the .reg file and select Merge

h.   Windows will prompt you: do you want to allow this app to make changes to your device? Click Yes

i.     The Registry Editor will prompt you explaining that making changes to the registry can cause components to stop working correctly, are you sure you want to continue? Click Yes

j.     The Registry Editor will (hopefully) say that they keys and values were successfully added to the registry. Click OK

 

Now, assuming no apparent problems occurred, resume the original instructions with step 10 (installing pywin32). You should see C:\Python27\ArcGIS10.7 as an installation destination now. Please let me know how it goes.

 

Jason

 

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python]

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore]

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7]

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\Help]

@=""

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\Help\Main Python Documentation]

@="C:\\Python27\\ArcGIS10.7\\Doc\\python2715.chm"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\InstallPath]

@="C:\\Python27\\ArcGIS10.7\\"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\InstallPath\InstallGroup]

@="Python 2.7"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\Modules]

 

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Python\PythonCore\2.7\PythonPath]

@="C:\\Python27\\ArcGIS10.7\\Lib;C:\\Python27\\ArcGIS10.7\\DLLs;C:\\Python27\\ArcGIS10.7\\Lib\\lib-tk"

 

 

 

 

Hi Jason, 

Thanks so much for your excellent directions! 

We have completed the above through step 9.

For Step 10, we downloaded the .exe file for pywin32-225.win32-py2.7.exe and tried to install the program. Below is what we see. So we are contacting you since it is not available to us and we want to be sure to install Python 2.7 correctly. Thanks, 

Sarah and John

image.png

 

image.png

 

On Wed, Oct 9, 2019 at 6:21 AM Jason Roberts <> wrote:

Hi Sarah,

 

Those commands show what is currently registered in the Windows File Association database as the default handler for .py files. We can see that it is C:\Python27\python.exe, which is the Python interpreter in the default location decided by the Python team, as opposed to the location that ArcGIS uses when it installs its own copy of Python, which is C:\Python27\ArcGIS10.7 for ArcGIS 10.7.x. This suggests that you manually installed Python yourself after installing ArcGIS. By default, whenever the Python installer runs, it updates the File Associations to so that the version being installed becomes the handler for Python files. So when you installed it, the installer changed the File Assocation from C:\Python27\ArcGIS10.7\python.exe to C:\Python27\python.exe.

 

While it is possible to have both ArcGIS and MGET use a version of Python that you install yourself, it can be quite tricky. Most likely, you were trying to get MGET working and installed Python yourself to see if that would help. I’m sorry if MGET’s installation instructions were not clear on that point. In any case, unless you have a specific reason for installing Python yourself, it would be best to change the Windows file associations back so that Windows will use ArcGIS’s copy of Python by default.

 

To do that, first start a Command Prompt with the “Run As Administrator” option. This is necessary so you can change the file associations, as opposed to just displaying them:

 

1.   Click the Windows Start button

2.   Type cmd.exe

3.   Right click on Command Prompt and select Run As Administrator:

 

 

4.   If it shows Windows PowerShell instead of Command Prompt, don’t run it. Contact me instead.

5.   After you click Run As Administrator, Windows will prompt you with Yes/No asking if you want the app to make changes to the device. Click Yes.

6.   Type in the following three ftype commands. I would send you a batch file to do it, but the email systems would just strip it off, thinking it was a malicious file.

 

 

That will change Windows back to using the ArcGIS 10.7.1’s Python interpreter. Now, to get MGET working, first you might as well remove MGET, pywin32, and Python itself that were manually installed to the non-ArcGIS location:

 

7.   Close all ArcGIS programs.

 

8.   From Windows Control Panel, Programs and Features:

a.    Remove Python 2.7 Marine Geospatial Ecology Tools, if present

b.    Remove Python 2.7 pywin32, if present

c.    Remove Python 2.7 itself, if present

 

9.   A bug in Python itself prevents MGET’s uninstaller from completing all of its tasks. Just to be sure that all of the current MGET is gone, use Windows File Explorer to manually delete the entire directory C:\Program Files\GeoEco.

 

Now install pywin32 and MGET to the ArcGIS copy of Python:

 

10. Install pywin32. The file name should be similar to pywin32-XXX.win32-py27.exe, where XXX is the build number (225 is the most recent build). When you run the installer it will ask you where you want to install it. Make sure you choose C:\Python27\ArcGIS10.7 which will hopefully be selected by default. If this is not available or you cannot figure out how to select it, stop without completing the installer and contact me.

 

11. Install MGET. You want MGET-0.8a72.win32-py27.exe. Download here if you don’t have it handy already.

 

12. Try MGET again. Hopefully it will work, but if not, almost definitely you will see a different error, because most likely it will at least be installed in the right place.

 

If you have any immediate questions about this procedure, feel free to ask before trying it. It looks complicated but is not that bad. Still, it might be scary if you have not done much of this kind of thing before.

 

Best,

 

Jason

 

 

 

 

Hi Jason, 

Thanks a bunch for your help. This is what the command says, so it looks like we have problem #1

 

 

image.png

Thanks, 
Sarah

 

On Fri, Oct 4, 2019 at 7:03 AM Jason Roberts <> wrote:

Hi Sarah and John,

 

This is definitely an installation problem. I should be able to help you get it working.

 

This specific message, ImportError: No module named _GeoEcoArcGISHelper, occurs when the MGET script invoked by ArcGIS (C:\Program Files\GeoEco\ArcGISToolbox\Scripts\RExploratoryPlotsScatterplotMatrixForArcGISTable.py in this case) tries to access the rest of MGET, which is a Python package similar to ArcGIS’s own arcpy and arcgisscripting packages, or the popular numpy and scipy packages, or the pywin32 package that you installed that MGET requires. _GeoEcoArcGISHelper is a special Python module that helps MGET’s ArcGIS scripts access the MGET package. This ImportError occurs when the script asks Python to load the module but the module does not exist.

 

Usually this problem happens when there are multiple versions of Python installed on the machine, as can happen when ArcGIS is upgraded or when Python is manually installed. It is ok to have multiple versions installed, but when this is done, it is important that 1) the Windows “file association” database be configured such that the default handler for Python scripts is the installation of Python that ArcGIS expects, and 2) pywin32 and MGET are installed to that installation of Python.

 

First let’s check #1. You have ArcGIS 10.7.1. For ArcGIS to work properly, it is important that Windows be set to use the copy of Python installed with ArcGIS 10.7. You can check it from a command prompt like this:

 

 

To start a command prompt, click the Windows Start button, type cmd.exe and press Enter. Then type the assoc and ftype commands as shown above. Send me a screenshot.

 

If the second command says something different, such as Python.file="C:\Python27\python.exe" ... then we’ll need to change it back to what ArcGIS wants. After this, we can check for problem #2.

 

Best,

Jason

 

 

Hi, 

My student John and I are new to MGET and trying to run a simple GLM in ArcMap between mussel cover and temperature to get started using the Fit GLM tool. I've also tried doing a Scatterplot Matrix for Table between some of my covariates. For both, I receive a  "No module named _GeoEcoArcGISHelper" error, which is copied below. 

 

I used the advice here https://lists.nicholas.duke.edu/sympa/arc/mget-help/2012-07/msg00011.html and have uninstalled and re-installed MGET with no luck. 

I updated my ArcGIS Desktop from 10.5 to 10.7.1 this morning, then uninstalled and reinstalled Python 2.7pywin32-224. I also have Python 2.7.16 in my program list, which I think I installed during the MGET setup. I see in the help that there may be a problem with calling the correct Python version? 

Thanks, 
Sarah and John

 

 

Executing: RExploratoryPlotsScatterplotMatrixForArcGISTable iButton_2 "RoboMaxDaily #" # Histogram Smooth Correlation # # # # 1000 6500 6500 10 white
Start Time: Thu Oct  3 14:01:07 2019
Running script RExploratoryPlotsScatterplotMatrixForArcGISTable...
Failed script RExploratoryPlotsScatterplotMatrixForArcGISTable...

Traceback (most recent call last):
  File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts\RExploratoryPlotsScatterplotMatrixForArcGISTable.py", line 1, in <module>
    import sys, _GeoEcoArcGISHelper
ImportError: No module named _GeoEcoArcGISHelper

Failed to execute (RExploratoryPlotsScatterplotMatrixForArcGISTable).
Failed at Thu Oct  3 14:01:07 2019 (Elapsed Time: 0.05 seconds)

 

 

--

Sarah A. Gravem, PhD (she/her)

Research Associate (Postdoctoral)
Oregon State University

541-737-8404

...🐌...🐌...🐌


 

--

Sarah A. Gravem, PhD (she/her)

Research Associate (Postdoctoral)
Oregon State University

541-737-8404

...🐌...🐌...🐌


 

--

Sarah A. Gravem, PhD (she/her)

Research Associate (Postdoctoral)
Oregon State University

541-737-8404

...🐌...🐌...🐌



--
Sarah A. Gravem, PhD (she/her)
Research Associate (Postdoctoral)
Oregon State University
541-737-8404
...🐌...🐌...🐌



Archive powered by MHonArc 2.6.19.

Top of Page