-1

My Code:

enter image description here

Error:

$ C:/Users/abc/AppData/Local/Programs/Python/Python38-32/python.exe e:/PYTHON/pdf_word_converter.py Traceback (most recent call last):
File "e:/PYTHON/pdf_word_converter.py", line 4, in conout = pypandoc.convert_file("E:\PYTHON\0267_Docusign.pdf", "docx", outputfile= "readme.docx") File "C:\Users\abc\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pypandoc__init__.py", line 137, in convert_file raise RuntimeError("source_file is not a valid path") RuntimeError: source_file is not a valid path

thmspl
  • 2,437
  • 3
  • 22
  • 48
Suchit SD
  • 1
  • 1

1 Answers1

0

It is because of the escape sequence.

Two options.

  • Replace all \ with \\ in "E:\PYTHON\0267_Docusign.pdf"

  • Use raw string r"E:\PYTHON\0267_Docusign.pdf"

abhilb
  • 5,639
  • 2
  • 20
  • 26
  • awesome but now i get an error "RuntimeError: Invalid input format! Got "pdf" but expected one of these: commonmark, creole, docbook, docx,and so on... – Suchit SD Jan 09 '20 at 10:06