-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: unhashable type: 'dict' #47
Comments
Hi there - thanks for the report. Could you provide the full traceback you're experiencing? Without knowing what line that error is occurring on and the path being followed, it's hard to know what's occurring. Also, if possible, could you share the complete, unabbreviated code snippet you're using? Just the part that references the shapefile path and the metadata editor setup is fine, but looking to see the full path as defined in the code |
Traceback (most recent call last): File "", line 2, in File "C:\Users\jbridwell\AppData\Local\Continuum\anaconda3\envs\acrpro\lib\site-packages\arcpy_metadata\metadata_editor.py", line 203, in init TypeError: unhashable type: 'dict' |
Code snippet: Note: I've also tried using just: |
Thanks - that's helpful. From your traceback, it looks like you're running this on ArcGIS Pro? Unfortunately, that's not supported yet, and I suspect it's the root cause of the message you're getting - until recently they haven't had the tools needed to export metadata to a format we could read. We haven't yet done the work needed to make sure it works in Python 3 or ArcGIS Pro. As far as solving the general case, it seems like maybe we could add some sort of alert when loaded in Python 3 that this is the case though, to prevent unknown issues like yours. Are you able to run it using a copy of ArcMap in the meantime? Sorry that this is the best option we have right now! |
Hey thanks Nick. Trying now in my Python 2.7 env with ArcMap. I'll comment again if I get it running. |
Hey Nick - I was able to get it to work in my 2.7 environment, but I have a follow up question. I was able to create an object/variable like this:
This returned the title and abstract, I guess from the .shp.xml file? |
Hi - glad it worked in 2.7! I suspect since you didn't mention it and based on the symptoms that you're not calling |
Another note for myself, looking at the docs, is that it might still be worth a complete example at the top that includes loading, reading data, and saving data, before showing all of the other capabilities. I think that was lost when the docs were refactored to be more complete. |
Yep. That was the issue! It's working great now. I have it iterating through about 1200 files now creating metadata. Works great. I did post an additional question about adding spatial reference and bounding box metadata. Let me know if that's possible. Thanks again. |
I have a simple shapefile I am trying to load into the MetadataEditor:
When I run this, I get the following error:
Any suggestions as to how to resolve this?
The text was updated successfully, but these errors were encountered: