Skip to content

Docx to DMU Fails in Pro 3.3 #111

@dmirandaUSGS

Description

@dmirandaUSGS

I am using the latest version of Docx to DMU, GeMS_DocxToDMU.py, version of 5/8/24. The tool works in Pro 3.2.x, but fails in 3.3. I get the following message:

  File "C:\ArcGIS\0_ToolBoxes\gems-tools-pro\Scripts\GeMS_DocxToDMU.py", line 33, in <module>
    import docx
  File "C:\ArcGIS\0_ToolBoxes\gems-tools-pro\Scripts\docx\__init__.py", line 14, in <module>
    from docx.parts.document import DocumentPart
  File "C:\ArcGIS\0_ToolBoxes\gems-tools-pro\Scripts\docx\parts\document.py", line 7, in <module>
    from docx.document import Document
  File "C:\ArcGIS\0_ToolBoxes\gems-tools-pro\Scripts\docx\document.py", line 10, in <module>
    from docx.section import Section, Sections
  File "C:\ArcGIS\0_ToolBoxes\gems-tools-pro\Scripts\docx\section.py", line 7, in <module>
    from collections import Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\Users\dmiranda\AppData\Local\ESRI\conda\envs\arcgispro-py3-mkdocs\Lib\collections\__init__.py)

I was able to get the tool to work by opening section.py and changing the import statement on line 7 to from collections.abc import Sequence. It seems like Sequence was moved from Collections to Collections.abc across the version of Python Pro 3.3 is now using.

The tool appears to work, and I get a DMU table that looks correct, but I am not sure if this is all that needs to be adjusted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions