Skip to content
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

Issues with textract.process while run within and executable created by pyinstaller #449

Open
vq75 opened this issue Dec 9, 2022 · 0 comments

Comments

@vq75
Copy link

vq75 commented Dec 9, 2022

I am having trouble to get textract.process to work while running within an executable created by pyinstaller

for (dir_path, dir_names, file_names) in walk(path):
   for f in file_names:
      path_t=os.path.join(dir_path, f)
      if t_ext=='.docx' or t_ext=='.xls' or t_ext=='.xlsx' or t_ext=='.pptx':
         print(path_t)
         text = textract.process(path_t)

getting following error:

C:\Users\u191174\Documents\Temp\Executable\s_words.xlsx 
incomplete escape \U at position 2

When running the python on VS Code, this error doesn't not appear, and when I debug path_t is correct and displays '\' but not when running within .exe file.

I am sure it's a path related issue...have the feeling that somehow the path_t is not taken as such.

I have converted the path for the 0s.walk to path=r"C:\Users\u191174\Documents\Temp\Executable" but same issue.

In code I have and if reading pdf with pytesseract and then reading docx, pptx and xlsx with textract....but while running the executable textract does cooperate and shares "incomplete escape \U at position 2". This doesn't happen when I run the py file from VS Code.

I am start thinking there maybe a bug within textract.

Looking forward for your feedback.

Kind Regards,

Vic Q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant