Giter Club home page Giter Club logo

Comments (4)

Belval avatar Belval commented on July 29, 2024 6

Did you both install poppler-utils first?

EDIT: Just to clarify, pdfinfo is an executable used by poppler (and therefore by pdf2image). Normally it should come with the poppler-utils package on Ubuntu.

from pdf2image.

rjsmethurst avatar rjsmethurst commented on July 29, 2024

I am having the exact same problem!

FileNotFoundError: [Errno 2] No such file or directory: 'pdfinfo'

when I try using either convert_from_path or convert_from_bytes

from pdf2image.

rjsmethurst avatar rjsmethurst commented on July 29, 2024

Full error message:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-8-1e5630119050> in <module>()
----> 1 images = convert_from_bytes(open('./testimage.pdf', 'rb').read())

/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdf2image/pdf2image.py in convert_from_bytes(pdf_file, dpi, output_folder, first_page, last_page, fmt, thread_count, userpw)
     88         f.write(pdf_file)
     89         f.flush()
---> 90         return convert_from_path(f.name, dpi=dpi, output_folder=output_folder, first_page=first_page, last_page=last_page, fmt=fmt, thread_count=thread_count, userpw=userpw)
     91 
     92 def __build_command(args, output_folder, first_page, last_page, fmt, uid, userpw):

/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdf2image/pdf2image.py in convert_from_path(pdf_path, dpi, output_folder, first_page, last_page, fmt, thread_count, userpw)
     27     """
     28 
---> 29     page_count = __page_count(pdf_path, userpw)
     30 
     31     if thread_count < 1:

/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pdf2image/pdf2image.py in __page_count(pdf_path, userpw)
    156         proc = Popen(["pdfinfo", pdf_path, '-upw', userpw], stdout=PIPE, stderr=PIPE)
    157     else:
--> 158         proc = Popen(["pdfinfo", pdf_path], stdout=PIPE, stderr=PIPE)
    159 
    160     out, _ = proc.communicate()

/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
    705                                 c2pread, c2pwrite,
    706                                 errread, errwrite,
--> 707                                 restore_signals, start_new_session)
    708         except:
    709             # Cleanup if the child failed starting.

/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1324                             else:
   1325                                 err_msg += ': ' + repr(orig_executable)
-> 1326                     raise child_exception_type(errno_num, err_msg)
   1327                 raise child_exception_type(err_msg)
   1328 

FileNotFoundError: [Errno 2] No such file or directory: 'pdfinfo'

from pdf2image.

macqueen09 avatar macqueen09 commented on July 29, 2024

Did you both install poppler-utils first?

EDIT: Just to clarify, pdfinfo is an executable used by poppler (and therefore by pdf2image). Normally it should come with the poppler-utils package on Ubuntu.

great .! Thanks !
solved the problem after apt install poppler-utils

from pdf2image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.