atlanhq / camelot

Camelot: PDF Table Extraction for Humans
https://camelot-py.readthedocs.io
Other
3.65k stars 355 forks source link

FileNotFoundError #484

Open Tonumoy opened 2 years ago

Tonumoy commented 2 years ago

My Code:

import camelot
file = "C:/Users/tonum/OneDrive/Desktop/Codes/SBI statement.pdf" 
tables = camelot.read_pdf(file)

The Error:

Traceback (most recent call last):

  Input In [22] in <cell line: 4>
    tables = camelot.read_pdf(file)

  File ~\anaconda3\envs\camelot\lib\site-packages\camelot\io.py:113 in read_pdf
    tables = p.parse(

  File ~\anaconda3\envs\camelot\lib\site-packages\camelot\handlers.py:172 in parse
    self._save_page(self.filepath, p, tempdir)

  File ~\anaconda3\envs\camelot\lib\site-packages\camelot\handlers.py:110 in _save_page
    with open(filepath, "rb") as fileobj:

FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/tonum/OneDrive/Desktop/Codes/SBI statement.pdf'

Maybe a naïve one, but couldn't figure out...

SWHL commented 2 years ago

This may be caused by spaces in the file path. Try:

import camelot
file = "C:/Users/tonum/OneDrive/Desktop/Codes/SBIstatement.pdf" 
tables = camelot.read_pdf(file)