Home > other >  Docx. Opc. Exceptions. PackageNotFoundError: Package not found at...
Docx. Opc. Exceptions. PackageNotFoundError: Package not found at...

Time:09-20

Python3.6 environment with the document into word file, display docx. Opc. Exceptions. PackageNotFoundError: Package not found at 'filename. Docx'. I am using an absolute path or didn't find the file.? Also didn't find a way to solve. All that trouble I folder is not empty.

CodePudding user response:

Code to stick your import is what mean?

 

# word file open
Doc_file=docx. Document (doc_path)

CodePudding user response:

The import docx
The from docx import Document # import libraries
The import CSV
The import OS
The import tempfile as expected
The import win32api
The import win32print

Adress=input (' please enter to read file location:)
Paths=r '{}'. The format (adress)
For a1, b1, c1 in OS. Walk (paths) :
For w in b1:
Path1=r '{} \ {}'. The format (adress, w)
For a, b, c in OS. Walk (path1) :
For wenjianming in c:
If 'instruction in wenjianming:
Path=r '{} \ {}'. The format (path1, wenjianming)
Print (path)
# the try:
The document=document (path) # import failure in this step, but some files may be some can't, the same file format
Tables.=the document tables
Tamble_name=tables [1]

CodePudding user response:

or cut picture

CodePudding user response:

That may be a doc format problem, I come across some WPS process file, although the suffix is doc, but library is to identify the file format,

Processing method is to save it again for docx file,

  • Related