data-wrangling
data-wrangling copied to clipboard
python: can't open file 'pdf2txt.py': [Errno 2] No such file or directory
In chap 05,when running this command to transfer a PDF to txt from my work folder.This error occurs.
python pdf2txt.py -o en-final-table9.txt EN-FINAL\ Table\ 9.pdf
Is it about the path?
Hi @conango ,
How did you install pdf2txt? Using pip? Did you use a virtual environment?
Thanks! -kj
Hi @kjam , I installed pdf2txt using pip in a real Win10 PC,not any virtual environment.
Thanks
and here is the screenshot.
ok, can you search your computer and see if the pdf2txt.py file is located somewhere on your computer? If so, then you can use the full path like D:\path\pdf2txt.py -o en-final-table9.txt (etc)
I looked at the source code of PDF Miner on GitHub. You can find pdf2txt.py
in the tools directory of the source code.
On PDFMiner documentation website the link to the source code can be found:
Here is where the pdf2text.py
file is
Download the file to a known directory, open a terminal, navigate to that directory and run your command:
$ python pdf2txt.py example.pdf