jackiekazil / data-wrangling

Code repository for Data Wrangling with Python (O'Reilly)
555 stars 562 forks source link

python: can't open file 'pdf2txt.py': [Errno 2] No such file or directory #12

Open conango opened 6 years ago

conango commented 6 years ago

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?

kjam commented 6 years ago

Hi @conango ,

How did you install pdf2txt? Using pip? Did you use a virtual environment?

Thanks! -kj

conango commented 6 years ago

Hi @kjam , I installed pdf2txt using pip in a real Win10 PC,not any virtual environment.

Thanks

conango commented 6 years ago

and here is the screenshot. qq 20180108090453

kjam commented 6 years ago

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)

stephensamonte commented 4 years ago

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:

image

PDF Miner GitHub Source Code

Here is where the pdf2text.py file is image

Download the file to a known directory, open a terminal, navigate to that directory and run your command:

$ python pdf2txt.py example.pdf

image