DOI-USGS / gems-tools-arcmap

Tools for working with the GeMS geologic map database schema in ArcGIS
Creative Commons Zero v1.0 Universal
42 stars 21 forks source link

CheckVersion causes failed execution #66

Open LindaTedrow opened 3 years ago

LindaTedrow commented 3 years ago

Since the introduction of the check version the tools have mostly failed.
Also of note, when freshly downloaded the Toolbox Title does not change -- it continues to be GeMS Tools for 10.5 2021-02-02 checkVersionError

Suggest updating this with each new version and when CheckVersion causes failure a url to the exact location for the latest would be helpful.

ethoms-usgs commented 3 years ago

Try putting an empty text file called __init__.py in the Scripts folder alongside all of the tool files. For some reason it's not required for me with my setup but might be for others.

ethoms-usgs commented 3 years ago

Thanks for bringing the toolbox title/label issue to our attention! I had not noticed that before. I will remove the version number and just leave it to report 'GeMS Tools for 10.5'.

At one point I was having the script report the URL to the repo but took it out when I saw it was not a hyperlink in the messages. Still, easily copied, so I will put it back in.

LindaTedrow commented 3 years ago

Used the gems download of today, checked that init.py is in Scripts Folder. It is of the Size 0KB

But still received the following error:

Executing: ProjectCrossSectionData W:\DATABASE_MAPS\24K\StateMap2020\ElkCityArea\Orogrande\fieldmap\OrograndeGeologicMap.mdb true # W:\DATABASE_MAPS\24K\StateMap2020\ElkCityArea\Orogrande\DEM\orograndeclip W:\DATABASE_MAPS\24K\StateMap2020\ElkCityArea\Orogrande\fieldmap\OrograndeGeologicMap.mdb\GeologicMap\CartographicLines UPPER_LEFT A 1 250 false false W:\DATABASE_MAPS\24K\StateMap2020\ElkCityArea\Orogrande\fieldmap\scratch.mdb true Start Time: Fri Apr 23 09:33:11 2021 Running script ProjectCrossSectionData... Failed script ProjectCrossSectionData...

Traceback (most recent call last): File "W:\Re_tool_stuff\2021Gems\gems-tools-arcmap-1.6.1\Scripts\GeMS_ProjectCrossSectionData_Arc10.py", line 34, in checkVersion(versionString, rawurl, 'gems-tools-arcmap') NameError: name 'checkVersion' is not defined

Failed to execute (ProjectCrossSectionData). Failed at Fri Apr 23 09:33:11 2021 (Elapsed Time: 0.09 seconds)

From: Evan Thoms @.> Sent: Thursday, April 22, 2021 8:51 PM To: usgs/gems-tools-arcmap @.> Cc: Tedrow, Linda @.) @.>; Author @.***> Subject: Re: [usgs/gems-tools-arcmap] CheckVersion causes failed execution (#66)

Try putting an empty text file called init.py in the Scripts folder alongside all of the tool files. For some reason it's not required for me with my setup but might be for others.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/usgs/gems-tools-arcmap/issues/66*issuecomment-825366222__;Iw!!JYXjzlvb!1stvJYWnapssV12ma8NhFVm0FqHdLGVukbcjkUBOhqZhZ49kvTZUVgiZ_uFcNTx0$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKYEVB55EREMJ44TVT2UTTTTKDVAPANCNFSM43NNOFTA__;!!JYXjzlvb!1stvJYWnapssV12ma8NhFVm0FqHdLGVukbcjkUBOhqZhZ49kvTZUVgiZ_lBQIFGS$.

ethoms-usgs commented 3 years ago

I'm sorry. Go get the latest version again (same number v1.6.1). I found a syntax error that might have been the problem.

That's fine that the init file is empty. It can have special instructions in it, but doesn't need to.

If this doesn't work try this: open GeMS_ProjectCrossSectionData_Arc10.py in a text editor and comment out the line that calls checkVersion, that is, make it read

# checkVersion(versionString, rawurl, 'gems-tools-arcmap')

and if my guess is right, that for some reason the script cannot find GeMS_utilityFunctions.py, then you will get an error at line 146 when it tries to call addMsgAndPrint.

LindaTedrow commented 3 years ago

Evan, I had tried to comment this out before both in this script and others has not really been successful.

This time by commenting out, I did get it to go past this check version block in the crosssection tool – ( I agree it is like it is not finding the script in the utility functions module. ) I tried

import arcpy, sys, os.path, math from GeMS_Definition import tableDict from GeMS_utilityFunctions import * from GeMS_utilityFunctions import checkVersion

perhaps not the correct way to call directly.

But, again, I got it to run past this just now (twice) but both times the process runs through the lines and points and then sends the “Cannot get exclusive schema lock” junk. [Graphical user interface, text, application, email Description automatically generated]

I have reboot twice; checked that nobody else had open; moved to my C drive. To no avail.

Went back to your profile code from before GeMS. Linda

From: Evan Thoms @.> Sent: Friday, April 23, 2021 10:49 AM To: usgs/gems-tools-arcmap @.> Cc: Tedrow, Linda @.) @.>; Author @.***> Subject: Re: [usgs/gems-tools-arcmap] CheckVersion causes failed execution (#66)

I'm sorry. Go get the latest version again (same number v1.6.1). I found a syntax error that might have been the problem.

That's fine that the init file is empty. It can have special instructions in it, but doesn't need to.

If this doesn't work try this: open GeMS_ProjectCrossSectionData_Arc10.py in a text editor and comment out the line that calls checkVersion, that is, make it read

checkVersion(versionString, rawurl, 'gems-tools-arcmap')

and if my guess is right, that for some reason the script cannot find GeMS_utilityFunctions.py, then you will get an error at line 146 when it tries to call addMsgAndPrint.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/usgs/gems-tools-arcmap/issues/66*issuecomment-825818588__;Iw!!JYXjzlvb!0fbCt-hONkVAEXQhNM3xFxQHHtMFMvW90_5ld3ShabeGpuPuwhVY3SuRHTh462p1$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKYEVB2XPSV3O7SZ53Y3EI3TKGXHBANCNFSM43NNOFTA__;!!JYXjzlvb!0fbCt-hONkVAEXQhNM3xFxQHHtMFMvW90_5ld3ShabeGpuPuwhVY3SuRHRmV6W5M$.

LindaTedrow commented 3 years ago

Same problem with validate database In pythonWin fixed the string on line 36

checkVersion(versionString, rawurl, 'gems-tools-arcmap')

Results: .. . . GeMS_ValidateDatabase_Arc10.py”, line 876 in If not arcpy.Exists(refgmd): Attribute Error: ‘module’ object has no attribute ‘Exists’

Failed to execute ValidateDatabase2

Also of note line 34: versionString = 'GeMS_ValidateDatabase_Arc10.py, version of 8 March 2021'

From: Evan Thoms @.> Sent: Friday, April 23, 2021 10:49 AM To: usgs/gems-tools-arcmap @.> Cc: Tedrow, Linda @.) @.>; Author @.***> Subject: Re: [usgs/gems-tools-arcmap] CheckVersion causes failed execution (#66)

I'm sorry. Go get the latest version again (same number v1.6.1). I found a syntax error that might have been the problem.

That's fine that the init file is empty. It can have special instructions in it, but doesn't need to.

If this doesn't work try this: open GeMS_ProjectCrossSectionData_Arc10.py in a text editor and comment out the line that calls checkVersion, that is, make it read

checkVersion(versionString, rawurl, 'gems-tools-arcmap')

and if my guess is right, that for some reason the script cannot find GeMS_utilityFunctions.py, then you will get an error at line 146 when it tries to call addMsgAndPrint.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/usgs/gems-tools-arcmap/issues/66*issuecomment-825818588__;Iw!!JYXjzlvb!0fbCt-hONkVAEXQhNM3xFxQHHtMFMvW90_5ld3ShabeGpuPuwhVY3SuRHTh462p1$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKYEVB2XPSV3O7SZ53Y3EI3TKGXHBANCNFSM43NNOFTA__;!!JYXjzlvb!0fbCt-hONkVAEXQhNM3xFxQHHtMFMvW90_5ld3ShabeGpuPuwhVY3SuRHRmV6W5M$.

ethoms-usgs commented 3 years ago

The Attribute Error getting thrown, that 'Exists' can't be found in the arcpy module, is worrying. What version of ArcMap are you using?

LindaTedrow commented 3 years ago

Evan, We are using version 10.5 I agree -- and I wrote a couple scripts to test the Exists function – It worked.

We had a student develop a tool bar of the GeMS tools, that is in testing. Did get this to run from the tool bar.

Curious!

Linda From: Evan Thoms @.> Sent: Wednesday, May 12, 2021 6:09 PM To: usgs/gems-tools-arcmap @.> Cc: Tedrow, Linda @.) @.>; Author @.***> Subject: Re: [usgs/gems-tools-arcmap] CheckVersion causes failed execution (#66)

The Attribute Error getting thrown, that 'Exists' can't be found in the arcpy module, is worrying. What version of ArcMap are you using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/usgs/gems-tools-arcmap/issues/66*issuecomment-840209969__;Iw!!JYXjzlvb!z4PwDps6g0DKSs0DJ7fH0VRdu_awm3YTVeLw8jIg48A7kVc1nZGrHGi_TsychJbk$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKYEVB2TB3JB4NRZ3HPM7ZLTNMRBPANCNFSM43NNOFTA__;!!JYXjzlvb!z4PwDps6g0DKSs0DJ7fH0VRdu_awm3YTVeLw8jIg48A7kVc1nZGrHGi_TnkXQWey$.

ethoms-usgs commented 3 years ago

Hmm, do you know if there are other versions of python installed on the computer? Perhaps there are conflicting namespaces. Can you upgrade or do a repair?

LindaTedrow commented 3 years ago

No – there should not be any other versions of Python on computer that I am using – The version of python is the version that comes with arcMap

I could try running on another machine to see if it causes similar problems. The version of Python used in ArcMap is different than that of ArcPro – which I am sure you are aware of.

The only way I could think of “a repair” would be to reinstall. But would wait on that and update to a more current version of ArcMap next month.

From: Evan Thoms @.> Sent: Thursday, May 13, 2021 10:38 AM To: usgs/gems-tools-arcmap @.> Cc: Tedrow, Linda @.) @.>; Author @.***> Subject: Re: [usgs/gems-tools-arcmap] CheckVersion causes failed execution (#66)

Hmm, do you know if there are other versions of python installed on the computer? Perhaps there are conflicting namespaces. Can you upgrade or do a repair?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/usgs/gems-tools-arcmap/issues/66*issuecomment-840717001__;Iw!!JYXjzlvb!xAbVDQwohRwuzr2dbunIaIGG824uubDqgZRLzC00qEDwB7xbWFZn0Cg9mFfUMmWo$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AKYEVB55SOGK7BI2QXVEZQLTNQE6HANCNFSM43NNOFTA__;!!JYXjzlvb!xAbVDQwohRwuzr2dbunIaIGG824uubDqgZRLzC00qEDwB7xbWFZn0Cg9mIf_1USV$.