no relationship of type ... in collection error
See original GitHub issueHi, I was trying python-docx with a .docx file which I got from a .doc file ‘Saved as’ a Strict Open XML Document with Microsoft Office Standard 2013. Unfortunately, when I’m trying to open the .docx file with python-docx, I get the error below. Does anybody have any idea what the problem is ?
Traceback (most recent call last):
File "fillin_subrep_contract.py", line 39, in <module>
fillin_contract_docx(sys.argv[1])
File "fillin_subrep_contract.py", line 20, in fillin_contract_docx
document = Document(wordfile)
File "/var/tmp/mow/git/virtualenvs/webdev/lib/python2.7/site-packages/docx/api.py", line 25, in Document
document_part = Package.open(docx).main_document_part
File "/var/tmp/mow/git/virtualenvs/webdev/lib/python2.7/site-packages/docx/opc/package.py", line 108, in main_document_part
return self.part_related_by(RT.OFFICE_DOCUMENT)
File "/var/tmp/mow/git/virtualenvs/webdev/lib/python2.7/site-packages/docx/opc/package.py", line 127, in part_related_by
return self.rels.part_with_reltype(reltype)
File "/var/tmp/mow/git/virtualenvs/webdev/lib/python2.7/site-packages/docx/opc/rel.py", line 63, in part_with_reltype
rel = self._get_rel_of_type(reltype)
File "/var/tmp/mow/git/virtualenvs/webdev/lib/python2.7/site-packages/docx/opc/rel.py", line 116, in _get_rel_of_type
raise KeyError(tmpl % reltype)
KeyError: u"no relationship of type 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument' in collection"
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
No relationship of type when opening Word document with ...
When trying to open a .dot file with python-docx , I am getting the error ...
Read more >I get a message about data type mismatch - Microsoft Support
I get a message about data type mismatch ... This error indicates that Access cannot match an input value to the data type...
Read more >Object->Relationships->Related Collections Error
I'm getting the following error msg when i try to add an object ... Do you have any relationship types defined for objects...
Read more >JavaScript data types and data structures - MDN Web Docs
Variables in JavaScript are not directly associated with any particular ... involves mismatched types, instead of throwing type errors.
Read more >Type 1 Error: Definition, False Positives, and Examples
The null hypothesis assumes no cause and effect relationship between the tested item and the stimuli applied during the test. A type I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

i have same issue , could you have other way using the python-docx to open the docx when saving as the strict open xml ?
Thanks @scanny, my bad for using a ‘Strict Open XML Document’. Re-generated my input document as a standard ‘Word document’ .docx and that seems to have fixed the problem.