python-3.xruntime-errorpypandoc

pypandoc giving the error “RuntimeError: source_file is not a valid path


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


Solution

  • It is because of the escape sequence.

    Two options.